Skip to content

offensive adding Content-Type always #909

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

Closed
chipitsine opened this issue Nov 11, 2016 · 5 comments
Closed

offensive adding Content-Type always #909

chipitsine opened this issue Nov 11, 2016 · 5 comments

Comments

@chipitsine
Copy link
Contributor

when I proxy requests to some http server, I expect the following behaviour:

if there's no Content-Type, so do not add one.
this is especially important for ajax file upload/download.

the default behaviour of nginx itself is expected, so header is not added.

but somehow, after nginx is compiled with lua-nginx-module, the deault behaviour is changed (due to "lua_use_default_type on")

I think, this lead to numerous misunderstanding and wrong installations. And I suggest to chenge the deault to "off"

yes, I can toggle that setting by myself, it is not that difficult. But I beleive that current default behaviour is wrong.

@agentzh
Copy link
Member

agentzh commented Nov 11, 2016

@chipitsine If you only use ngx_proxy module in a location, then the default type should not get affected. Will you provide a minimal and standalone example that can reproduce the problem on our side? Thanks!

@mijohansen
Copy link

Hi, we did also have problem with this directive when using then a proxy. It killed our redirects(from the proxied request) by adding the default content type to them. I think the behaviour was when there was no content type set in the response from the backend server the issued occured.

Thanks to this post I tried to set lua_use_default_type off and that solved the issues for us.

@agentzh
Copy link
Member

agentzh commented Nov 30, 2018

We're working on a patch to make this setting not this aggressive for non-Lua-generated responses (like responses from a proxy module). @spacewander

@thibaultcha
Copy link
Member

Referencing the patches for future reference and keeping track of this issue once we are satisfied with them: #1422 and #1445.

@agentzh
Copy link
Member

agentzh commented Feb 4, 2019

I think this is already resolved. Feel free to reopen this if the problem still persists in the latest version, like this one:

https://openresty.org/download/openresty-1.15.8.1rc0.tar.gz

@agentzh agentzh closed this as completed Feb 4, 2019
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

No branches or pull requests

4 participants