1
0
mirror of https://github.com/cmur2/dyndnsd.git synced 2025-07-05 05:11:16 +02:00

Allow dyndnsd to use address from X-Real-IP

This commit is contained in:
cn
2016-11-30 21:59:12 +01:00
parent a9083e916e
commit f76c5933d7
4 changed files with 58 additions and 32 deletions

View File

@ -166,4 +166,11 @@ describe Dyndnsd::Daemon do
last_response.should be_ok
last_response.body.should == 'good 127.0.0.1'
end
it 'uses clients remote IP address from X-Real-IP header if behind proxy' do
authorize 'test', 'secret'
get '/nic/update?hostname=foo.example.org', '', 'HTTP_X_REAL_IP' => '10.0.0.1'
last_response.should be_ok
last_response.body.should == 'good 10.0.0.1'
end
end