Skip to content

fix: harden oauth-protected-resource header and URL edge cases - #131

Merged
mandarini merged 1 commit into
mainfrom
fix/oauth-resource-sweep
Aug 28, 2026
Merged

fix: harden oauth-protected-resource header and URL edge cases#131
mandarini merged 1 commit into
mainfrom
fix/oauth-resource-sweep

Conversation

@mandarini

@mandarinimandarini commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Final bug sweep of src/oauth-protected-resource/, fixing the three edge cases from the #113 review that survived the #116/#117 rewrites. Advertised URLs now percent-encode " and \ so a hostile X-Forwarded-Host or configured resourceServer cannot break out of the WWW-Authenticate quoted-string; 401 enrichment sets the header in place with a copy fallback, so responses with immutable headers (fetch-proxied) or already-consumed bodies no longer throw and .url/.redirected survive; and the Edge Functions derivation throws MISSING_RESOURCE_SERVER on a root path with no function segment instead of silently advertising a bare /functions/v1. The other two deferred cases (local prefix inference, trailing-slash 404) were already resolved by the rewrites and stay covered by existing tests.

@pkg-pr-new

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@supabase/server@131

commit: e1e6bdb

@mandarinimandarini self-assigned this Aug 27, 2026
@mandarini
mandarini marked this pull request as ready for review August 27, 2026 16:37
@mandarini
mandarini requested review from a team as code ownersAugust 27, 2026 16:37
@mandarini
mandarini merged commit 0c1a2b6 into mainAug 28, 2026
9 checks passed
@mandarini
mandarini deleted the fix/oauth-resource-sweep branch August 28, 2026 15:26
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mandarini@spydon