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