GeezerVison is showing github.com — fix(npm): use combined Accept header to support Artifactory upstreams by pgarbe · Pull Request #241 · git-pkgs/proxy
Conversation
pgarbe
commented
Aug 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Why
- JFrog Artifactory (and similar upstreams) return HTTP 406 when the npm client sends only the abbreviated packument content type (
application/vnd.npm.install-v1+json), breaking package metadata lookups entirely.
- Sending a combined Accept header with a quality-factor fallback (
application/json;q=0.8) lets the proxy work with both the official npm registry and stricter upstreams without sacrificing the bandwidth benefit for registries that do support the abbreviated format.
What
Changed the default Accept header for npm package metadata requests from the abbreviated-only type to a combined header that prefers the smaller format but gracefully falls back to full JSON, leaving the cooldown path unchanged (it still requests full metadata exclusively).
Closes #228
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
When cooldown is disabled, send:
Accept: application/vnd.npm.install-v1+json;q=1.0, application/json;q=0.8
This allows upstreams like JFrog Artifactory that return 406 for the
abbreviated packument type to fall back to full JSON metadata, while
letting the public npm registry continue to serve the smaller
abbreviated format it prefers.
When cooldown is enabled, keep sending only application/json because
the abbreviated format omits the "time" map required for version age
filtering.
Fixes git-pkgs#228
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Reviewers
andrew
andrew approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.