aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorStephen Becker IV <github@deathbyescalator.com>2013-06-18 14:22:30 -0700
committerStephen Becker IV <github@deathbyescalator.com>2013-06-19 06:29:52 -0700
commit8ffd139edd062fe3e888895d4af80730a0798758 (patch)
tree4c2b60f55cb322a4739363a4125ccc6de78ff84e /actionpack/lib
parent0f89689b2357f39da52515b83391db58689a1361 (diff)
downloadrails-8ffd139edd062fe3e888895d4af80730a0798758.tar.gz
rails-8ffd139edd062fe3e888895d4af80730a0798758.tar.bz2
rails-8ffd139edd062fe3e888895d4af80730a0798758.zip
Fix undefined method `ref' for nil:NilClass for bad accept headers
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/http/mime_type.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb
index 61dbf2b96c..ef144c3c76 100644
--- a/actionpack/lib/action_dispatch/http/mime_type.rb
+++ b/actionpack/lib/action_dispatch/http/mime_type.rb
@@ -175,7 +175,7 @@ module Mime
def parse(accept_header)
if accept_header !~ /,/
accept_header = accept_header.split(PARAMETER_SEPARATOR_REGEXP).first
- parse_trailing_star(accept_header) || [Mime::Type.lookup(accept_header)]
+ parse_trailing_star(accept_header) || [Mime::Type.lookup(accept_header)].compact
else
list, index = AcceptList.new, 0
accept_header.split(',').each do |header|