Summary
In shared/utils/repository-meta.ts, the object spread order when building fetch options causes ...options to overwrite the entire headers object, discarding the merged User-Agent: npmx header (and any other headers built up prior to the spread).
This is a pre-existing issue that originated in app/composables/useRepoMeta.ts on main and was moved as-is into the new shared utility in #2764.
Problem
The current pattern (at 8 locations) is:
// Incorrect — outer ...options clobbers the headers object
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options }
Fix
Spread options first, then override headers with the merged value:
// Correct — User-Agent preserved, caller headers merged in
{ ...options, headers: { 'User-Agent': 'npmx', ...options.headers } }
Affected locations
shared/utils/repository-meta.ts lines 118, 160, 197, 236, 275, 321, 422, 466
References
Summary
In
shared/utils/repository-meta.ts, the object spread order when building fetch options causes...optionsto overwrite the entireheadersobject, discarding the mergedUser-Agent: npmxheader (and any other headers built up prior to the spread).This is a pre-existing issue that originated in
app/composables/useRepoMeta.tsonmainand was moved as-is into the new shared utility in #2764.Problem
The current pattern (at 8 locations) is:
Fix
Spread
optionsfirst, then overrideheaderswith the merged value:Affected locations
shared/utils/repository-meta.tslines 118, 160, 197, 236, 275, 321, 422, 466References