Skip to content

fix: Avoid panics when content is longer than content length header#33

Merged
baszalmstra merged 1 commit intoprefix-dev:mainfrom
astral-sh:konsti/upstream/fix-range-panic
Mar 24, 2026
Merged

fix: Avoid panics when content is longer than content length header#33
baszalmstra merged 1 commit intoprefix-dev:mainfrom
astral-sh:konsti/upstream/fix-range-panic

Conversation

@konstin
Copy link
Contributor

@konstin konstin commented Mar 24, 2026

Upstreaming of astral-sh#8, which fixed astral-sh/uv#18316.

This fix handles two cases:

  • The server sends more bytes than initially promised in the Content-Length header
  • The server sends more or less bytes than the content-range indicated

As a side effect, we remove the requirement that the initial response must be towards the end (-len:).

@baszalmstra baszalmstra merged commit 28fcf33 into prefix-dev:main Mar 24, 2026
4 checks passed
@github-actions github-actions bot mentioned this pull request Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic with invalid content length in range reader

2 participants