Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: return rendered content from _UIRenderer.render instead of HttpResponse #268

Merged
merged 2 commits into from
Dec 11, 2018

Conversation

mofr
Copy link
Contributor

@mofr mofr commented Dec 11, 2018

According to DRF BaseRenderer documentation BaseRenderer.render should return response content:

The method should return a bytestring, which will be used as the body of the HTTP response (https://www.django-rest-framework.org/api-guide/renderers/#custom-renderers)

It leads to a very serious problem of double request_finished signal emitting. It happens when drf.Response interprets the HttpResponse returned by render as a file and calls close on it.

@mofr
Copy link
Contributor Author

mofr commented Dec 11, 2018

I can add a regression test for the case if you wish, but it looks quite usual for python language. (So crazy)

@axnsan12
Copy link
Owner

Yeah... good spotting, thanks!

@axnsan12 axnsan12 merged commit c52daae into axnsan12:master Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants