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
It's not currently possible for a renderer to return None and cause the http response to return with no body. This means a renderer cannot return a valid 204 response HTTPNoContent.
Possible solutions would be to fix https://github.com/Pylons/pyramid/blob/master/pyramid/renderers.py#L576 such that if result is None then delete content_length, content_type, and do not set body instead of the current behavior of turning it into an empty string. At the very least the empty string should be b'' instead of unicode, because if a charset is not set on the response a unicode string causes issues.
Or just allow a renderer to return its own response object, overriding request.response.
The text was updated successfully, but these errors were encountered:
It's not currently possible for a renderer to return
None
and cause the http response to return with no body. This means a renderer cannot return a valid 204 responseHTTPNoContent
.Possible solutions would be to fix https://github.com/Pylons/pyramid/blob/master/pyramid/renderers.py#L576 such that if result is None then delete content_length, content_type, and do not set body instead of the current behavior of turning it into an empty string. At the very least the empty string should be
b''
instead of unicode, because if a charset is not set on the response a unicode string causes issues.Or just allow a renderer to return its own response object, overriding
request.response
.The text was updated successfully, but these errors were encountered: