From b392786f657151b97aade6a0290cbbdbdd579518 Mon Sep 17 00:00:00 2001 From: Ajay Bhargava Date: Mon, 27 Jul 2026 21:16:01 -0400 Subject: [PATCH] fix(npm): accept successful OIDC exchange status --- scripts/preflight-npm-oidc.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/preflight-npm-oidc.sh b/scripts/preflight-npm-oidc.sh index eaa0c09..fef4a59 100644 --- a/scripts/preflight-npm-oidc.sh +++ b/scripts/preflight-npm-oidc.sh @@ -77,7 +77,10 @@ for p in "${packages[@]}"; do -H "Content-Length: 0" \ "${registry}/-/npm/v1/oidc/token/exchange/package/${escaped}")" - if [ "$code" = "200" ] && grep -q '"token"' "$body"; then + # npm currently returns 201 Created for a successful exchange. Accept any + # successful 2xx response so the preflight follows HTTP semantics rather + # than depending on one registry implementation detail. + if [[ "$code" =~ ^2[0-9]{2}$ ]] && grep -q '"token"' "$body"; then printf ' %-34s READY\n' "$full" else msg="$(node -e '