-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Distinguish between truncated and excess content in response (#3273)
`HTTPResponse._raw_read` raises `IncompleteRead` if the content length does not match the expected content length. For malformed responses (e.g. 204 response with content) the re-raised `ProtocolError` was a bit too unclear about the unexpected excess content being the reason for the exception. With this change, the exception points out, that the client is not dealing with a connection error but a protocol violation.
- Loading branch information
1 parent
cfe52f9
commit fa54179
Showing
4 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Made raised ``urllib3.exceptions.ProtocolError`` more verbose when a response contains content unexpectedly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters