Currently, the midleware.php file redirects all paths that have a trailing slash to its correct path with a 301 response code - relevant code portion here
However, this 301 does not have the Access-Control-Allow-Origin Header in its initial 301 response. So, if the clientside app makes a request to a URL with a trailing slash, the request fails:
Currently, the midleware.php file redirects all paths that have a trailing slash to its correct path with a
301
response code - relevant code portion hereHowever, this
301
does not have theAccess-Control-Allow-Origin
Header in its initial 301 response. So, if the clientside app makes a request to a URL with a trailing slash, the request fails:However, it looks like the fix is pretty simple. From the Slim documentation:
So, I think if we swap the order of the two middleware functions, then the CORs header will be added first, even if we have a redirect.