-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Set Content-Length header on DELETE, PUT when no entity body #236
Comments
hmm sounds odd to me but I guess we could |
I'd appreciate that. I've had to monkey-patch it in on my own for the time being, and setting content-length to 0 for DELETE operations has managed to fix the problem. The |
@damianb Can you provide a simple example to show the problem please. |
Any DELETE request through nginx without body :( curl seems to do this by default. |
@defunctzombie
atm I have a hack like this one to override the |
@soyuka can you make a PR with appropriate tests for this? |
@defunctzombie are there specific instructions to run tests? I did |
@defunctzombie sorry made a lot of mistakes in my first commit it's late here ^^. |
As mentioned in #236 the HTTP RFC doesn't require DELETE request to have a Content-Length, so I think nginx is being too picky here. Has anybody reported the issue to nginx? If the bug can be fixed in nginx I'd rather avoid adding a workaround superagent. |
a client workaround will still likely be necessary due to propagation of that patch/update across the web. even if nginx patches it today, it wouldn't land anytime soon in rhel, deb, ubuntu, so handling nginx's edge case would be necessary in the meantime. |
@damianb I see no client workaround here. How can you set the @pornel agreed, but it then say in |
Continuing the discusison from the #711 PR here: OPTIONS:
DELETE:
Yes indeed, I read both, but the OPTIONS paragraph was a more logical explanation to why does nginx sends 411 when DELETE happens without Content-Length. I can't find any relevent issues on the nginx Trac, I'll try to dig deeper. |
node v0.10.42 is rejecting DELETE requests with both Content-Length: 0 and Transfer-Encoding: chunked headers. We can force Content-Length: 0 to work around the problem. see http-party/node-http-proxy#960 and ladjs/superagent#236
Similar to request/request#41 - I'm seeing issues with an nginx server handling an API where DELETE operations to it are now returning HTTP 411 - there's a transfer-encoding header being injected somewhere along the way (not by superagent, likely nodejs itself because there's no content-length header) and it is causing severe problems with http requests.
The text was updated successfully, but these errors were encountered: