You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the app is configured to configured return JSON formatted payloads using \yii\web\JsonResponseFormatter and configured to perform caching with yii\filters\HttpCache the response includes a body of null when the cache is hit. However per rfc7232
A 304 response cannot contain a message-body; it is always terminated by the first empty line after the header fields.
This would be a problem for 204 No Content responses as well however \yii\web\Response::prepare() explicitly sets the content of the response to '' when the status is 204. It seems the same ought to be done for 304s as well. If this change is welcome I'd be happy to open a PR.
When the app is configured to configured return JSON formatted payloads using
\yii\web\JsonResponseFormatter
and configured to perform caching withyii\filters\HttpCache
the response includes a body ofnull
when the cache is hit. However per rfc7232This would be a problem for
204 No Content
responses as well however\yii\web\Response::prepare()
explicitly sets the content of the response to''
when the status is 204. It seems the same ought to be done for 304s as well. If this change is welcome I'd be happy to open a PR.What steps will reproduce the problem?
yii\filters\HttpCache
What is the expected result?
The expected result is a response that with a 304 status and no response body.
What do you get instead?
A response which includes the response body
null
. This is indicated by curl error message:Additional info
The text was updated successfully, but these errors were encountered: