Exempt the WCTP gateway routes from CSRF verification #23
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/wctp-csrf-exempt"
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?
POST /wctp and the carrier webhooks under /wctp/... are registered in
routes/web.php, so they run through VerifyCsrfToken, but none was on its
except list. Enterprise Hosts and carriers cannot send a CSRF token, so
production answered them 419. Both '/wctp' and '/wctp/*' are listed:
the wildcard alone does not match the bare Enterprise Host endpoint.
Laravel skips CSRF verification under unit tests, which is why every WCTP
test passed. The new test checks each registered WCTP POST route against
the middleware's own except-list matching instead.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com