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

DELETE request issued to nginx back-end fails with 411 #338

Closed
wants to merge 4 commits into from

Conversation

ian7
Copy link

@ian7 ian7 commented Nov 22, 2012

@mmalecki
Copy link
Contributor

Interesting. I'll accept it, but please fix coding style:

if (req.method === 'DELETE') {
  req.headers['content-length'] = '0';
}

and make sure that indentation matches rest of the code. Thanks!

@ian7
Copy link
Author

ian7 commented Nov 28, 2012

Done. let me know if this is ok.

  • M.

On Thu, Nov 22, 2012 at 8:36 PM, Maciej Małecki [email protected]:

Interesting. I'll accept it, but please fix coding style:

if (req.method === 'DELETE') {
req.headers['content-length'] = '0';
}

and make sure that indentation matches rest of the code. Thanks!


Reply to this email directly or view it on GitHubhttps://github.com//pull/338#issuecomment-10643388.

@indexzero
Copy link
Contributor

Reluctantly +1

@rc1
Copy link

rc1 commented Feb 13, 2013

In my case, as an observation, nginx is stripping the header's 'content-length'. When I run locally 'content-length' exists on the req and when I run remotely heroku 'content-length' is stripped from the req. The easy fix for me was to just add it back to the req before passing to node-http-proxy.

@andreareginato
Copy link

Similar problem for CORS features. When the browser makes the preflight requestI get a 411 error. As far as the preflight is automatically made from the browser there is no way to set content-length to 0 and CORS will never work with node http proxy.

@mmalecki
Copy link
Contributor

Actually, now that I think about it, a DELETE request can have a body. We happen to use such requests ourselves in production.
We should check if a Content-Length is already defined, I think.
@indexzero @ian7 opinions?

@andreareginato
Copy link

That is true. I check is needed. I would add also OPTIONS (for CORS preflight) on the list of verbs to check.

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.

None yet

5 participants