-
Notifications
You must be signed in to change notification settings - Fork 2k
change: avoided generating Content-Type header when getting response … #1445
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
change: avoided generating Content-Type header when getting response … #1445
Conversation
Are we fine with breaking the behavior described in #92? Using the nginx configuration provided in the issue, the current master branch produces the following responses (which seem correct):
But with this patch, the
|
@thibaultcha |
@spacewander It seems to work well 👍 However, since breaking the use case mentioned above is a regression introduced by this commit, the commit in your other PR (#1449) should be squashed into this PR (in the resulting commit). This is in order to ensure atomicity. After all, the behavior described above is not failing in the master branch, only because of this commit, so it is this commit that must be updated accordingly. Will you close your other PR and squash its patch in this PR? Thanks! |
When rebasing #1449 on top of this branch, we do get the Content-Type header in the response as expected:
But we still experience a regression in that accessing |
It's my bad that I didn't mention that the regression is introduced by the 017e004. Currently, if one has set the response header (which doesn't need to be
I think it is not a regression, but a better way to deal with missing Content-Type header. Instead of overdoing, I think it would be better to return the real Content-Type header. When the header is missing, return |
@spacewander Gotcha. I confirmed the regression indeed comes from 017e004 and pushed fixes and tweaks to your proposed patch in #1449. Thank you for clarifying.
Yes, I have to say I agree. |
ddd4fd5
to
617e09c
Compare
… getting all response headers. The previous behavior assumed that nginx will always generate the Content-Type header if it is missing. However in some cases (such as the upstream response not having a Content-Type header), nginx will not generate the Content-Type header itself. Thus, generating the Content-Type when getting response headers may create an unexpected Content-Type header in the response. Signed-off-by: Thibault Charbonnier <[email protected]>
617e09c
to
efdae5a
Compare
…headers.
The previous behavior assumed that Nginx will always generate the
Content-Type header if it is missing.
However, in some cases, like the upstream response doesn't have the Content-Type
header, Nginx will not generate the Content-Type header. So generating
Content-Type header when getting response headers may create an unexpected
Content-Type header in the response.
I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.