Skip to content

Commit

Permalink
Add documentation to Rack::Request#hostname.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Feb 7, 2020
1 parent 7370cd4 commit d902198
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/rack/request.rb
Expand Up @@ -301,7 +301,10 @@ def host
split_authority(self.authority)[0]
end

# Returns an address suitable for being used with `getaddrinfo`.
# Returns an address suitable for being to resolve to an address.
# In the case of a domain name or IPv4 address, the result is the same
# as +host+. In the case of IPv6 or future address formats, the square
# brackets are removed.
def hostname
split_authority(self.authority)[1]
end
Expand Down

0 comments on commit d902198

Please sign in to comment.