lib/rack/utils.rb in rack-2.2.3.1 vs lib/rack/utils.rb in rack-2.2.4
- old
+ new
@@ -20,10 +20,13 @@
InvalidParameterError = QueryParser::InvalidParameterError
DEFAULT_SEP = QueryParser::DEFAULT_SEP
COMMON_SEP = QueryParser::COMMON_SEP
KeySpaceConstrainedParams = QueryParser::Params
+ RFC2822_DAY_NAME = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]
+ RFC2822_MONTH_NAME = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]
+
class << self
attr_accessor :default_query_parser
end
# The default number of bytes to allow parameter keys to take up.
# This helps prevent a rogue client from flooding a Request.
@@ -325,11 +328,11 @@
# that I'm certain someone implemented only that option.
# Do not use %a and %b from Time.strptime, it would use localized names for
# weekday and month.
#
def rfc2109(time)
- wday = Time::RFC2822_DAY_NAME[time.wday]
- mon = Time::RFC2822_MONTH_NAME[time.mon - 1]
+ wday = RFC2822_DAY_NAME[time.wday]
+ mon = RFC2822_MONTH_NAME[time.mon - 1]
time.strftime("#{wday}, %d-#{mon}-%Y %H:%M:%S GMT")
end
# Parses the "Range:" header, if present, into an array of Range objects.
# Returns nil if the header is missing or syntactically invalid.