mirror of
https://github.com/cmur2/dyndnsd.git
synced 2025-09-24 17:52:02 +02:00
Allow dyndnsd to use address from X-Real-IP
This commit is contained in:
@@ -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
|
||||
|
@@ -6,3 +6,7 @@ require 'rack/test'
|
||||
require 'dyndnsd'
|
||||
require 'support/dummy_database'
|
||||
require 'support/dummy_updater'
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.expect_with(:rspec) { |c| c.syntax = :should }
|
||||
end
|
||||
|
Reference in New Issue
Block a user