diff --git a/lib/rack/request.rb b/lib/rack/request.rb index d77fa2657..0956addc7 100644 --- a/lib/rack/request.rb +++ b/lib/rack/request.rb @@ -46,7 +46,7 @@ def content_type; @env['CONTENT_TYPE'] end # For more information on the use of media types in HTTP, see: # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 def media_type - content_type && content_type.split(/\s*[;,]\s*/, 2)[0].downcase + content_type && content_type.split(/\s*[;,]\s*/, 2).first.downcase end # The media type parameters provided in CONTENT_TYPE as a Hash, or