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
When responding to a credentialed request, the server must specify an origin in the value of the Access-Control-Allow-Origin header, instead of specifying the "*" wildcard.
Also, one may not want to delegate OPTIONS to the remote server, as that remote server may need authorization while the browser will not include any credentials for the OPTIONS request:
if ('OPTIONS' == $request_method) {
http_response_code(200);
exit;
}
since the purpose of this script is to bypass CORS check
Aside: the CORS headers are not needed when hosting this very proxy on the same domain as the web pages that make the requests. But given the configuration for $valid_requests hosting on the same domain is indeed not a requirement. (And I myself also needed to add those headers.)
since the purpose of this script is to bypass CORS check, the response should contain CORS headers.
I've tried the script on my php server and requests from javascript didn't succeed because of missing CORS headers. After adding
to the php file, everything works fine.
The text was updated successfully, but these errors were encountered: