Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/preflight-npm-oidc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down
Loading