Meta: Patch curl to ignore all trailing bytes after end of zlib stream
Without this patch, curl errors on any trailing bytes after the end of a zlib stream. For web compatibility, we must ignore trailing bytes instead of erroring.
This matches Firefox and Chrome:
- https://searchfox.org/firefox-main/rev/04cf27582307a9c351e991c740828d54cf786b76/netwerk/streamconv/converters/nsHTTPCompressConv.cpp#607-613
- https://source.chromium.org/chromium/chromium/src/+/main:net/filter/gzip_source_stream.cc;l=240-250;drc=397107e399d4b0f4a6e801e7a888d7d71778529c;bpv=0;bpt=1
Fixes https://github.com/LadybirdBrowser/ladybird/issues/7091
Hello!
One or more of the commit messages in this PR do not match the Ladybird code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.
patching curl for this seems awkward from a distribution point of view. For example, your quirk patch is not included in the flatpak build. third-party packaging from e.g AUR and nixpkgs (not to mention future fedora/COPR/deb packages) would need updated to vendor a private libcurl with our patch applied.
- is there a way to tolerate this error without digging into libcurl itself?
- can we ask upstream libcurl if they'd be more receptive to an upstream 'tolerate naughty servers' toggle at this point in time?
imo this should just be upstreamed (as a proper flag, not "ladybird quirks mode").
Agree with Ali. To pull this in, I'd hope for
-
a separate commit pulling in libcurl as-is from vcpkg, to better determine what is "upstream port" and what is "ladybird changes" when looking at commit history
-
upstreamable patch with links to curl discussions or PR
Given that bagder seems positive about ladybird using libcurl, hopefully a series of patches related to "browser quirks" will be more likely to be accepted now than when the referenced discussions happened.