Skip to content

Commit 4613bdf

Browse files
committed
Fix media type matching
1 parent 721a635 commit 4613bdf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/jsonapi/acts_as_resource_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module JSONAPI
44
module ActsAsResourceController
5-
MEDIA_TYPE_MATCHER = /(.+".+"[^,]*|[^,]+)/
5+
MEDIA_TYPE_MATCHER = /.+".+"[^,]*|[^,]+/
66
ALL_MEDIA_TYPES = '*/*'
77

88
def self.included(base)
@@ -169,7 +169,7 @@ def valid_accept_media_type?
169169

170170
def media_types_for(header)
171171
(request.headers[header] || '')
172-
.match(MEDIA_TYPE_MATCHER)
172+
.scan(MEDIA_TYPE_MATCHER)
173173
.to_a
174174
.map(&:strip)
175175
end

0 commit comments

Comments
 (0)