diff options
Diffstat (limited to 'lib/rack/utils.rb')
-rw-r--r-- | lib/rack/utils.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb index 46362bab..333d8bf5 100644 --- a/lib/rack/utils.rb +++ b/lib/rack/utils.rb @@ -27,7 +27,7 @@ module Rack module_function :unescape DEFAULT_SEP = /[&;] */n - + # Stolen from Mongrel, with some small modifications: # Parses a query string by breaking it up at the '&' # and ';' characters. You can also use this to parse @@ -394,6 +394,12 @@ module Rack # Responses with HTTP status codes that should not have an entity body STATUS_WITH_NO_ENTITY_BODY = Set.new((100..199).to_a << 204 << 304) + SYMBOL_TO_STATUS_CODE = HTTP_STATUS_CODES.inject({}) { |hash, (code, message)| + hash[message.downcase.gsub(/\s|-/, '_').to_sym] = code + hash + } + + # A multipart form data parser, adapted from IOWA. # # Usually, Rack::Request#POST takes care of calling this. |