summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-02-08 00:49:30 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-02-08 00:52:30 +1300
commitd902198c067417c3e4d859910efb4861825ff82f (patch)
treea8dd0f3f430fce7f2da243c0fa1bd448d1343e11
parent7370cd4a5233ad80bf5a61d7ccf7ace9059c0ad6 (diff)
downloadrack-d902198c067417c3e4d859910efb4861825ff82f.tar.gz
Add documentation to `Rack::Request#hostname`.
-rw-r--r--lib/rack/request.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/rack/request.rb b/lib/rack/request.rb
index 58ee5683..6bb785c2 100644
--- a/lib/rack/request.rb
+++ b/lib/rack/request.rb
@@ -301,7 +301,10 @@ module Rack
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