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

Check to see if response has Content-Length before setting it. #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

philipn
Copy link

@philipn philipn commented Aug 25, 2014

Because of #12, I had to move PhasedRenderMiddleware to the bottom(ish) of my MIDDLEWARE_CLASSES. This fixed the issue with the MessageMiddleware, but caused new issues with other middleware I had that altered the length of the response.

Ideally, these other middleware classes would check to see if Content-Length was set, and if so, re-adjust the content length header. Unfortunately, this doesn't seem to be the case, and it seems smart for us to check to see if the header's set before adding it in here, anyway.

Because of codysoyland#12, I had
to move PhasedRenderMiddleware to the bottom(ish) of my
`MIDDLEWARE_CLASSES`. This fixed the issue with the `MessageMiddleware`,
but caused new issues with other middleware I had that altered the
length of the response.

Ideally, these other middleware classes would check to see if
`Content-Length` was set, and if so, re-adjust the content length
header. Unfortunately, this doesn't seem to be the case, and it seems
smart for us to check to see if the header's set before adding it in
here, anyway.
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.

1 participant