Repository navigation
Set accept header to application/octet-stream for downloading package tarballs - #63
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 29943128-aaf7-4f58-97a1-694feb5e183c
cmoesel
approved these changes
Oct 31, 2026
cmoesel
left a comment
Member
There was a problem hiding this comment.
Thanks for the contribution. I wish we had done this sooner!
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.
Description:
Explicitly request
Accept: application/octet-streamwhen downloading package tarballs throughFHIRRegistryClient, using both Axios and the HTTPS/browser transport. JSON metadata requests keep their original config.Setting Axios's
responseType: 'stream'does not override the defaultAccept: application/json, text/plain, */*header. With those defaults,packages2can return the JSON metadata instead of a tarball. FPL attempts to extract the metadata as an archive, causingTAR_BAD_ARCHIVEand a generic download failure.Discovered against
hl7.fhir.r6.core#6.0.0-snapshot1, where the primary registry returns 404 and the fallback required an explicit binary-content request. Existing cached package contents masks the failure.Regression coverage checks the Axios archive header, unchanged JSON metadata lookups, the HTTPS archive header, and a primary-404/fallback scenario that returns metadata unless binary content is requested. Cache behavior is unchanged; no existing cache contents were modified.
Note that the
packages2server is also receiving a fix for this issue - I continued the PR to ensure we do not run into this on generic NPM servers or updated configurations in the future.Testing Instructions:
Targeted registry and HTTP utility tests: passed (6 suites, 82 tests).
Build, lint, and formatting: all passed.
The full test suite was not run.
Related Issue:
None linked.
#committers > Build Failure @ 💬