diff options
author | Andre Arko <andre@arko.net> | 2011-11-11 21:22:49 -1000 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2011-11-11 21:25:08 -1000 |
commit | 9432163c60fc4387d1dfb11ca7c92a08ce72f1c2 (patch) | |
tree | 1fd9413c466e7c00a1ad19e56b1f0d659ae079f2 /actionmailer/test/abstract_unit.rb | |
parent | c3035e1800949e7df04ea3e3a0567adacbce41a6 (diff) | |
download | rails-9432163c60fc4387d1dfb11ca7c92a08ce72f1c2.tar.gz rails-9432163c60fc4387d1dfb11ca7c92a08ce72f1c2.tar.bz2 rails-9432163c60fc4387d1dfb11ca7c92a08ce72f1c2.zip |
refactor RemoteIp middleware
- return the last forwarded IP before REMOTE_ADDR to handle proxies
- remove completely superfluous RemoteIpGetter class
- remove duplication of trusted proxies regexp
- remove unused constant from Request
- move comments from Request to where they are actually relevant
- edit comments for clarity of purpose
The original code (confusingly) tried to return REMOTE_ADDR both at the beginning and the end of the chain of options. Since REMOTE_ADDR is _always_ set, this is kind of silly. This change leaves REMOTE_ADDR as the last option, so that proxied requests will be assigned the correct remote IP address.
Diffstat (limited to 'actionmailer/test/abstract_unit.rb')
0 files changed, 0 insertions, 0 deletions