Open tommyboylab opened 4 years ago
Access-Control-Allow-Methods
is only included if the Access-Control-Request-Method
header is set. This header is only relevant in preflight requests, i.e. OPTIONS requests. Browsers that wish to make a non-simple request via a special method should automatically set the Access-Control-Request-Method
header.
If CORS Anywhere generates a Access-Control-Allow-Methods
response header, it typically contains only one HTTP verb, because the Access-Control-Request-Method
request header has only one verb.
The fact that your sample response contains more than one HTTP verb suggests that the requested resource has added the CORS headers itself.
Are you sure that the issue that you're observing is caused by CORS Anywhere?
I posted the same issue over at the Axios repo, here. They closed it under being a Sever (CORS?) issue. I'm not sure what is causing the issue, only that:
I was receiving CORS issues with the initial get request I created a cors-anywhere proxy and routed the api though it -> Worked as expected on desktop I tried the same request on mobile -> Failed to receive the same data I tried the request on mobile again, this time with desktop mode on -> Worked as expected
I'm not sure how to properly debug the request, or what the issue could be. Is there possibly any way to spoof the User Agent of the request? see if by forcing the desktop User Agent the content will load?
I'd like to do this at the request level, so users themselves don't need to switch their browsers manually
@tommyboylab Hey, did you figure it out? I am having the same issue.
omg...still happening!! after 3 year....same issue here axios get + cors everywhere
I just had a seemingly similar issue. I found i needed to add into my allowed CORS policy on the server support for www.mydomain.com (as prevously I only had "mydomain.com"). Mobile broswers seemed to default to adding the www (eg. www.domain.com) which was not yet allowed in the server CORS policy.
I just had a seemingly similar issue. I found i needed to add into my allowed CORS policy on the server support for www.mydomain.com (as prevously I only had "mydomain.com"). Mobile broswers seemed to default to adding the www (eg. www.domain.com) which was not yet allowed in the server CORS policy.
just modify the code with set able USER AGENT, the proxy will mirror everything including USERAGENT so when difference Client device call the proxy will have difference behavior, so for consistency just add confinable USERAGENT to the code.
var setUserAgent = process.env.CORSANYWHERE_USERAGENT;
if (setUserAgent) {
serverOptions.setHeaders = {
'user-agent': setUserAgent
}
}
@karsiong Hi there, I was wondering where you added the code for the user agent. I am knew to CORS Everywhere and we are having the same issue with our mobile APIs not going through.
Describe the bug My cors-anywhere server is not returning the data from the api endpoint on mobile
I'm using an axios.get request, and while using the page on a mobile phone, or mobile responsive windows in developer consoles (Chrome, Safari responsive modes) the response is missing Access-Control-Allow-Methods.
To Reproduce
Expected behaviour Data should load, as it's loading on desktop resolutions (and in desktop mode on mobile phone browsers)
Environment:
Additional context/Screenshots