Accept JSON requests more liberally in API
This commit is contained in:
parent
eb62ab96ff
commit
db7de0c038
@ -37,8 +37,11 @@ module API
|
||||
end
|
||||
|
||||
def json_filter!
|
||||
return if request.format.json?
|
||||
head :not_acceptable, content_type: 'application/json'
|
||||
if request.format.json? || request.accepts.include?(:json)
|
||||
request.format = :json
|
||||
else
|
||||
head :not_acceptable, content_type: 'application/json'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user