forked from urllib3/urllib3
-
Notifications
You must be signed in to change notification settings - Fork 0
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
`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. Closes urllib3#3261
- Loading branch information
1 parent
23f2287
commit da7e153
Showing
3 changed files
with
39 additions
and
1 deletion.
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 re-raised ProtocolError more verbose regarding corner cases. |
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