You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fe6b6af
Browse filesBrowse the repository at this point in the historyBrowse files
Let the consent form actually reach the site it returns to
Two browser behaviours broke the consent button in staging, and neither
unit nor end-to-end tests could see them: both drive the endpoint with
fetch, and fetch enforces neither referrer policy nor CSP.
First, the page's own `referrer-policy: no-referrer` made the browser send
a literal `Origin: null` on the same-origin form POST, so our origin check
rejected it. The page now sends `same-origin`: real Origin on the way in,
still no referrer on the way out. The check also treats `null` as "no
origin stated", so one header can no longer close the door again.
Second, `form-action 'self'` covered the POST but not the 302 that follows
it, and Chrome applies form-action to the whole redirect chain. The grant
was being stored and the return silently blocked — nothing happened on
screen, no error anywhere. The directive now carries the client's redirect
origin, taken from the URI that was already matched against the registered
allowlist, and read through `new URL().origin` so only scheme+host+port can
reach the header.
Both lessons are locked by assertions that fail when reverted.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments