-
Notifications
You must be signed in to change notification settings - Fork 692
Description
I updated the bundle recently and I found a discrepancy in the behavior of my API.
Here is my configuration:
fos_rest:
routing_loader:
include_format: false
view:
formats:
json: ~
xml: ~
view_response_listener: force
format_listener:
rules:
- { path: '^/api', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
- { path: '^/', stop: true }Before the update, I received JSON response when I asked for JSON ("Accept: application/json") and I received XML response when I asked for XML ("Accept: application/xml").
After the update, I received JSON response no matter what I asked for.
Basically, it was because when I asked for XML, I got the fallback instead. I figured that the problem was with the mime-type extraction process and I changed my configuration to the following:
fos_rest:
routing_loader:
include_format: false
view:
formats:
json: ~
xml: ~
view_response_listener: force
format_listener:
rules:
- { path: '^/api', priorities: ['json', 'xml', 'application/xml'], fallback_format: json, prefer_extension: false }
- { path: '^/', stop: true }I found that the mime-type for XML was transformed to text/xml thus not matching the value in my header (application/xml).
My actual commit is 82b8388.
My previous commit was 9fe38af
Is that behavior normal? Is this a bug?