Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Drive CORS

Is there a reason why Google Drive does not set Access-Control-Allow-Origin:* on the file data available at downloadUrl.
I am interested in downloading binary files from Google Drive using ajax/CORS.
However, the only way to achieve this seems to be through a proxy.

like image 333
Max Ferguson Avatar asked Jun 03 '14 22:06

Max Ferguson


People also ask

Does Google Drive allow CORS?

I recently found that Google Drive does accept CORS requests if a valid access token is provided.

Does Google Chrome support CORS?

CORS will work in chrome. Just use chrome is safe-mode, i.e., use disable security settings. Google it about it, or you can even start from command line also.

How do you fix a CORS error?

Cross-Origin Resource Sharing (CORS) errors occur when a server doesn't return the HTTP headers required by the CORS standard. To resolve a CORS error from an API Gateway REST API or HTTP API, you must reconfigure the API to meet the CORS standard.

How do I fix CORS header Access-Control allow Origin missing?

If the server is under your control, add the origin of the requesting site to the set of domains permitted access by adding it to the Access-Control-Allow-Origin header's value. You can also configure a site to allow any site to access it by using the * wildcard. You should only use this for public APIs.


1 Answers

With Access-Control-Allow-Credentials: true

Because it would be a huge security hole.

Any website you visited would be able to grab files from your Google Drive if you were logged into Google.

Without Access-Control-Allow-Credentials: true or with Access-Control-Allow-Credentials: false

You could ask Why is the Access-Control-Allow-Origin header necessary at all?

like image 87
SilverlightFox Avatar answered Sep 18 '22 13:09

SilverlightFox