fix(e2e): send Origin on profile POST so CSRF middleware admits it #297
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-284-e2e-profile-csrf-origin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The account-ui profile spec posts
/settings/profileoverpage.request.post, which sends noOriginheader. BUNYIP-259 (PR #291) added anOrigin/Referer-matching CSRF middleware to bunyip-web that fails closed (403) on any state-changing POST whoseOrigindoes not match the BFF host, so the stand-in request the spec uses for the (CI-unrenderable) browser form was rejected with 403 on every attempt.A real browser form submission carries
Origin: <web origin>, which matches Host and passes the check. This spec exists precisely because/settingscannot be rendered on the GPU-less CI runner, so it must replicate that header itself. SetOrigin: new URL(env.baseURL).originon the POST and refresh the stale comment that claimed no CSRF handling was needed. The read-onlyGET /settingsre-fetch is unaffected (the middleware skips GET).#BUNYIP-284