lib/protocol/http/headers.rb in protocol-http-0.24.4 vs lib/protocol/http/headers.rb in protocol-http-0.24.5
- old
+ new
@@ -10,10 +10,11 @@
require_relative 'header/cache_control'
require_relative 'header/etag'
require_relative 'header/etags'
require_relative 'header/vary'
require_relative 'header/authorization'
+require_relative 'header/date'
module Protocol
module HTTP
# Headers are an array of key-value pairs. Some header keys represent multiple values.
class Headers
@@ -237,9 +238,12 @@
'proxy-authenticate' => Multiple,
# Custom headers:
'set-cookie' => Header::SetCookie,
'cookie' => Header::Cookie,
+
+ 'date' => Header::Date,
+ 'expires' => Header::Date,
}.tap{|hash| hash.default = Split}
# Delete all headers with the given key, and return the merged value.
def delete(key)
deleted, @fields = @fields.partition do |field|