Class: Rack::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/yodel/middleware/request.rb

Instance Method Summary collapse

Instance Method Details

#scheme_and_hostObject

almost verbatim copy of the ‘url’ method; just we don’t append the full_path to the constructed url



5
6
7
8
9
10
11
12
13
14
# File 'lib/yodel/middleware/request.rb', line 5

def scheme_and_host
  url = scheme + "://"
  url << host

  if scheme == "https" && port != 443 ||
      scheme == "http" && port != 80
    url << ":#{port}"
  end
  url
end