ProcessWire CORS
Basic Fix
PHP
header("Access-Control-Allow-Origin: http://your-origin-site.com");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
Apache
Header set Access-Control-Allow-Origin "http://your-origin-site.com"
Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
Fix with HTMX
PHP
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, hx-current-url, hx-request");
Apache
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, hx-current-url, hx-request"
There might be more CORS settings necessary for HTMX!!!
Date
10.04.2024
Categories
- ProcessWire
Tags
- Notes