FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 704 forks source link

Responses with HTTP status 204/ 304 must not set the Content-Type header #2298

Open kryptychon opened 3 years ago

kryptychon commented 3 years ago

Hi there,

IMHO the Content-Type header must not be set if the ViewHandler is dealing with an empty Response.

I'm aware this might break BC but nevertheless, a Content-Type header does not really make sense in an empty response.

goetas commented 2 years ago

makes sense, could you please add a test for this change?