diff --git a/lib/rack/request.rb b/lib/rack/request.rb index 4c4cf61..120c2bf 100644 --- a/lib/rack/request.rb +++ b/lib/rack/request.rb @@ -40,7 +40,7 @@ module Rack # 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).first.downcase + content_type && content_type.to_s.split(/\s*[;,]\s*/, 2).first.downcase end # The media type parameters provided in CONTENT_TYPE as a Hash, or