-
Notifications
You must be signed in to change notification settings - Fork 128
urllib3 2.0: Double reading causes IncompleteRead error #295
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
1 task
frostming
added a commit
to frostming/cacheyou
that referenced
this issue
May 8, 2023
Fixes psf#295 Signed-off-by: Frost Ming <me@frostming.com>
frostming
added a commit
to frostming/cacheyou
that referenced
this issue
May 8, 2023
Fixes psf#295 Signed-off-by: Frost Ming <me@frostming.com>
frostming
added a commit
to frostming/cacheyou
that referenced
this issue
May 18, 2023
Fixes psf#295 Signed-off-by: Frost Ming <me@frostming.com>
frostming
added a commit
to frostming/cacheyou
that referenced
this issue
May 18, 2023
Fixes psf#295 Signed-off-by: Frost Ming <me@frostming.com>
woodruffw
pushed a commit
to woodruffw-forks/cachecontrol
that referenced
this issue
May 22, 2023
Fixes psf#295 Signed-off-by: Frost Ming <me@frostming.com>
frostming
added a commit
to frostming/cacheyou
that referenced
this issue
May 25, 2023
Fixes psf#295 Signed-off-by: Frost Ming <me@frostming.com>
frostming
added a commit
that referenced
this issue
May 29, 2023
Fixes #295 Signed-off-by: Frost Ming <me@frostming.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Uh oh!
There was an error while loading. Please reload this page.
In the
Serializer.dumps()
method, the underlying fp is replaced with a new, never read stream, which causes the stream to be double read: https://github.com/ionrock/cachecontrol/blob/c05ef9eff1c9ac176481fb99e7a7188aa5b4e17b/cachecontrol/serialize.py#L35-L36This will lead to an IncompleteRead error on urllib3 2.0 since it starts to strictly check the
HTTPResponse.length_remaining
attribute which will be a negative value(content_length - 2*content_length = -content_length).I have no idea why this replacement is necessary.This can be reproduced with the following minimal reproducible example:
The error:
Note that the read size 4658 is twice the content length 2329
Related to #264
The text was updated successfully, but these errors were encountered: