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 — npm: add upstream.npm_full_metadata to serve publish times without cooldown by VictorCodesseira · Pull Request #297 · git-pkgs/proxy

Conversation

@VictorCodesseira

@VictorCodesseira VictorCodesseira commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

PR #241 sends a combined Accept header so upstreams that reject the abbreviated
packument type fall back to full metadata, but the combined header still
prefers the abbreviated format — so registry.npmjs.org keeps returning
packuments with no time map, and with cache_metadata on, that timeless body
is served to every client regardless of the client's own Accept header. The
only way to get full packuments today is to enable cooldown, which ties a
metadata-format choice to a filtering feature.

Timeless packuments break clients that gate on publish age. Yarn 4's
npmMinimalAgeGate (on by default in recent Yarn) fails closed when
timestamps are missing, so every resolution through the proxy is refused, old
versions included:

yarn add [email protected]
➤ YN0016: │ lodash@npm:4.17.21: All versions satisfying "4.17.21" are quarantined

Changes:

  • Add upstream.npm_full_metadata (env PROXY_UPSTREAM_NPM_FULL_METADATA,
    default false); when set, the npm metadata fetch uses application/json
    exclusively, independent of cooldown
  • Wire it through the shared Proxy struct the way GradleReadOnly and
    DirectServe are
  • Document it in config.example.yaml and docs/configuration.md
  • Test beside the existing Accept-header cases: the option forces full
    metadata with cooldown disabled

Placed under upstream beside the npm URL it modifies, since that section
already carries fetch behavior (allow_private_hosts, allow_loopback,
auth) — happy to move it top-level next to cache_metadata/metadata_ttl
if you prefer that grouping, or to a different shape entirely (for example
honoring the client's Accept header with per-format caching, which would also
work but costs a second cached copy per package).

go test ./..., go fmt, go vet clean.

Companion PR: #296 (making the cooldown download check read stored publish
times instead of re-parsing packuments).

Sorry, something went wrong.

Uh oh!

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

All reactions
@VictorCodesseira
Add upstream.npm_full_metadata to serve publish times without cooldown
526872b
- Request application/json from the npm upstream when the option is set,
  independent of cooldown, so served packuments carry the "time" map
- Wire the option through the shared Proxy struct and the
  PROXY_UPSTREAM_NPM_FULL_METADATA environment override
- Document it in config.example.yaml and docs/configuration.md
- Test that the option forces full metadata with cooldown disabled
@VictorCodesseira VictorCodesseira mentioned this pull request Sep 1, 2026
npm: read the stored publish time in the cooldown download check #296
Merged
@VictorCodesseira
VictorCodesseira marked this pull request as ready for review September 1, 2026 18:53
andrew
andrew approved these changes Sep 2, 2026
View reviewed changes

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upstream is the right place for this — it modifies how upstream.npm is fetched. Thanks.

Sorry, something went wrong.

Uh oh!

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

All reactions
@andrew
andrew merged commit 7e1cb68 into git-pkgs:main Sep 2, 2026
5 checks passed

Uh oh!

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

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.

Uh oh!

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

2 participants

@VictorCodesseira @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.