Fix undefined method `ref' for nil:NilClass for bad accept headers
Merge pull request #11000 from sbeckeriv/accept_header

Fix undefined method `ref' for nil:NilClass for bad accept headers