lib/protocol/http/headers.rb in protocol-http-0.19.0 vs lib/protocol/http/headers.rb in protocol-http-0.20.0

- old
+ new

@@ -26,10 +26,11 @@ require_relative 'header/connection' require_relative 'header/cache_control' require_relative 'header/etag' require_relative 'header/etags' require_relative 'header/vary' +require_relative 'header/authorization' module Protocol module HTTP # Headers are an array of key-value pairs. Some header keys represent multiple values. class Headers @@ -168,10 +169,11 @@ return deleted end # Add the specified header key value pair. + # # @param key [String] the header key. # @param value [String] the header value to assign. def add(key, value) self[key] = value end @@ -214,12 +216,10 @@ 'content-disposition' => false, 'content-length' => false, 'user-agent' => false, 'referer' => false, 'host' => false, - 'authorization' => false, - 'proxy-authorization' => false, 'if-modified-since' => false, 'if-unmodified-since' => false, 'from' => false, 'location' => false, 'max-forwards' => false, @@ -230,9 +230,13 @@ 'vary' => Header::Vary, # Headers specifically for proxies: 'via' => Split, 'x-forwarded-for' => Split, + + # Authorization headers: + 'authorization' => Header::Authorization, + 'proxy-authorization' => Header::Authorization, # Cache validations: 'etag' => Header::ETag, 'if-match' => Header::ETags, 'if-none-match' => Header::ETags,