-
-
Notifications
You must be signed in to change notification settings - Fork 9.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
Sending an empty body from a file, with Content-Length: 0 header times out #4215
Comments
Hey @dobesv, this is a known bug in the 2.x versions of requests and was originally recorded in #3066. We have a patch submitted (#3897) and merged into the 3.0.0 branch which will address this. For the time being, Requests should be capable of determining the required headers in it's current state. If you don't manually pass a |
@nateprewitt Thanks, sounds great. Sorry I didn't find the other issue in the first place. |
This patch fixes issue with timeout during empty file deploy. More details here psf/requests#4215 Change-Id: I44c11605badf0d30be6c220e9964be22aadd27f0
Sending a POST request with an empty body read from an empty file and a
Content-Length: 0
header times out after a long time instead of doing normal processing.Expected Result
Sending an empty body from a file with
Content-Length: 0
should send the request and return a result in a similar amount of time as a non-empty request, or a request withoutContent-Length: 0
, or an empty body provided as a string.For example:
Or using a string body:
Or a non-empty file:
Actual Result
However, with the specific combination of a
Content-Length: 0
header and an empty open file descriptor, the request times out after 4 minutes with an error.Reproduction Steps
System Information
Workaround
Check if the file is empty before sending and, if it is, substitute the file descriptor for an empty string.
The text was updated successfully, but these errors were encountered: