Repository navigation
Raise httpc's header limit for archive downloads - #135
Merged
Merged
Conversation
GitHub's release-download redirects now send about 11 KB of response headers, most of it a content-security-policy. That exceeds the 10 KiB max_header_size httpc enforces by default in recent Erlang/OTP patch releases, so precompiled XLA archive downloads fail with header_too_long. Raise the limit to 64 KiB for these requests.
polvalente
approved these changes
Oct 24, 2026
This was referenced Oct 24, 2026
This was referenced Oct 24, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub's release-download redirects now send about 11 KB of response headers, about 9.2 KB of it a
content-security-policyheader. Erlang/OTP 29.0.6, 28.5.0.6 and 27.3.4.17 added amax_header_sizerequest option to httpc that defaults to 10,240 bytes, so downloading the precompiled XLA archive fails on those releases and later with{:header_too_long, {:max, 10240}}.This passes
max_header_size: 65_536with the request options inXLA.Utils.download/3, the same change as philss/rustler_precompiled#113 and elixir-lang/elixir_make#98.Older releases don't know the option. The download still works there, but httpc logs
Invalid option {max_header_size,65536} ignoredonce per request.Checks:
XLA.Utils.download/3returns{:error, "reason: {:header_too_long, {:max, 10240}}"}onmainwith OTP 29.1.2 and{:ok, ...}with this change. On OTP 29.0.3, which predates the option, it succeeds with the notice above.exlacompile on OTP 29.1.2 downloads the precompiled archive from GitHub releases.mix format --check-formattedandmix compile --warnings-as-errorspass.