method
setup_forwarded_info
v1_9_1_378 -
Show latest stable
-
0 notes -
Class: WEBrick::HTTPRequest
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180 (0)
- 1_9_3_125 (38)
- 1_9_3_392 (0)
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
setup_forwarded_info()
private
Hide source
# File lib/webrick/httprequest.rb, line 388 def setup_forwarded_info @forwarded_server = self["x-forwarded-server"] @forwarded_proto = self["x-forwarded-proto"] if host_port = self["x-forwarded-host"] @forwarded_host, tmp = host_port.split(":", 2) @forwarded_port = (tmp || (@forwarded_proto == "https" ? 443 : 80)).to_i end if addrs = self["x-forwarded-for"] addrs = addrs.split(",").collect(&:strip) addrs.reject!{|ip| PrivateNetworkRegexp =~ ip } @forwarded_for = addrs.first end end