GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@pgarbe pgarbe commented Aug 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions
@pgarbe @claude
fix(npm): use combined Accept header to support Artifactory upstreams
ced83df
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]>
@pgarbe
pgarbe force-pushed the fix/npm-combined-accept-header branch from 52b5d42 to ced83df Compare August 10, 2026 07:12
@pgarbe
pgarbe marked this pull request as ready for review August 10, 2026 07:12
andrew
andrew approved these changes Aug 10, 2026
View reviewed changes
@andrew
andrew merged commit 14f80ce into git-pkgs:main Aug 10, 2026
@andrew andrew mentioned this pull request Aug 10, 2026
npm: support GitHub Packages SHA tarball URLs #238
Closed
@VictorCodesseira VictorCodesseira mentioned this pull request Sep 1, 2026
npm: add upstream.npm_full_metadata to serve publish times without cooldown #297
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@andrew andrew andrew approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

npm: decouple upstream Accept header choice from cooldown configuration

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@pgarbe @andrew
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.