summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 0a1a714a0d..6a906ad11e 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -476,6 +476,11 @@ All arguments named KEY is case-insensitive.
: self[ key ] = val
sets the header field corresponding to the case-insensitive key.
+: fetch( key [,default] )
+
+ returns the header field corresponding to the case-insensitive key.
+ returns the default value if there's no header field named key.
+
: key?( key )
true if key exists.
KEY is case insensitive.
@@ -923,6 +928,10 @@ module Net
@header.delete key.downcase
end
+ def fetch(*args)
+ @header.fetch(*args)
+ end
+
def key?( key )
@header.key? key.downcase
end