method

setup_forwarded_info

Importance_0
v1_9_2_180 - Show latest stable - 0 notes - Class: WEBrick::HTTPRequest
setup_forwarded_info() private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

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
Register or log in to add new notes.