diff options
Diffstat (limited to 'lib/net/http/response.rb')
-rw-r--r-- | lib/net/http/response.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb index 6b044c3d34..bde3b5b440 100644 --- a/lib/net/http/response.rb +++ b/lib/net/http/response.rb @@ -79,6 +79,7 @@ class Net::HTTPResponse initialize_http_header nil @body = nil @read = false + @uri = nil end # The HTTP version supported by the server. @@ -93,6 +94,10 @@ class Net::HTTPResponse attr_reader :message alias msg message # :nodoc: obsolete + # The URI used to fetch this response. The response URI is only available + # if a URI was used to create the request. + attr_reader :uri + def inspect "#<#{self.class} #{@code} #{@message} readbody=#{@read}>" end @@ -118,6 +123,10 @@ class Net::HTTPResponse error! unless self.kind_of?(Net::HTTPSuccess) end + def uri= uri # :nodoc: + @uri = uri.dup if uri + end + # # header (for backward compatibility only; DO NOT USE) # |