Skip to content
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

Fix chunked encoding with broken ending #454

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

algesten
Copy link
Owner

Some websites do not end chunked encoding correctly. The spec says the end should be:

0\r\n
\r\n

However some sites stop short after 0\r\n. Curl handles this case fine.

Close #325

@algesten
Copy link
Owner Author

I don't actually have a plan for how to fix this just yet.

I don't know whether the people behind the chunked_transfer crate would be open to a fix where the final \r\n is optional. Otherwise we need to handle it un ureq.

@Shnatsel
Copy link

This needs to be handled with care, since it might allow HTTP desync attacks and request smuggling.

@jhwgh1968 might know more about this particular case.

@algesten
Copy link
Owner Author

@Shnatsel Good point! I provided a naive fix in upstream repo – maybe needs more thought. 🤔 frewsxcv/rust-chunked-transfer#11

@algesten algesten marked this pull request as ready for review December 9, 2022 16:22
@jsha
Copy link
Collaborator

jsha commented Dec 10, 2022

I comment on #325 (comment) - I think we should first implement trailers and see if we still have this problem. At least one of the affected sites that I spot-checked was actually sending trailers.

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.

"Error while decoding chunks" on some websites
3 participants