mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Setting the content_type sets the response Content-Type
Otherwise we have two headers, 'Content-Type' and 'CONTENT_TYPE'. I don't know when Rails decides to use one or the other.
This commit is contained in:
parent
0433869cc1
commit
05fd59644d
@ -57,7 +57,6 @@ end
|
|||||||
ActionController::Renderers.add :jsonapi do |json, options|
|
ActionController::Renderers.add :jsonapi do |json, options|
|
||||||
json = serialize_jsonapi(json, options).to_json(options) unless json.is_a?(String)
|
json = serialize_jsonapi(json, options).to_json(options) unless json.is_a?(String)
|
||||||
self.content_type ||= media_type
|
self.content_type ||= media_type
|
||||||
headers.merge! ActiveModelSerializers::Jsonapi::HEADERS[:response]
|
|
||||||
self.response_body = json
|
self.response_body = json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user