aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2014-03-05 10:06:07 +0100
committerGibheer <gibheer@gmail.com>2014-03-05 10:06:07 +0100
commit7f0df1746a184326e2ed58467bbb05938f221e3a (patch)
treeb7af9c2b312c03e320ec63a20e1057f450a834b8
parent5b16243973c2af4ff83e34b0801dfa27e903aeaa (diff)
correct forwarded-for headerv0.2.0
-rw-r--r--lib/zero/request/client.rb2
-rw-r--r--spec/unit/zero/request/client/address_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/zero/request/client.rb b/lib/zero/request/client.rb
index eba4d7a..97b991d 100644
--- a/lib/zero/request/client.rb
+++ b/lib/zero/request/client.rb
@@ -5,7 +5,7 @@ module Zero
# the key for the ip of the client
KEY_REMOTE_ADDR = 'REMOTE_ADDR'
# in proxy setups, this is the real address of the client
- KEY_FORWARDED_FOR = 'X_FORWARDED_FOR'
+ KEY_FORWARDED_FOR = 'HTTP_X_FORWARDED_FOR'
# the key for the hostname
KEY_REMOTE_HOST = 'REMOTE_HOST'
# the key for the user agent
diff --git a/spec/unit/zero/request/client/address_spec.rb b/spec/unit/zero/request/client/address_spec.rb
index 09c6da9..69a5c50 100644
--- a/spec/unit/zero/request/client/address_spec.rb
+++ b/spec/unit/zero/request/client/address_spec.rb
@@ -16,7 +16,7 @@ describe Zero::Request::Client, '#address' do
let(:env) do
{
'REMOTE_ADDR' => proxy,
- 'X_FORWARDED_FOR' => address
+ 'HTTP_X_FORWARDED_FOR' => address
}
end