This is a sample project to show issues of CORS uploads in FireFox with Exoscale. DO NOT USE ANY OF THIS CODE IN PRODUCTION.
-
- Sign up and make a bucket on Exoscale's portal.
-
- Setup
backend/backend-server
with bucket, API Key and secret.
- Setup
-
- Setup CORS configuration:
<?xml version="1.0" ?>
<CORSConfiguration xmlns="http:https://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>WHATEVER OTHER DOMAIN YOU WANT TO TRY</AllowedOrigin>
<AllowedOrigin>http:https://localhost:8080</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedHeader>Authorization</AllowedHeader>
<AllowedHeader>Content-Type</AllowedHeader>
<AllowedHeader>Host</AllowedHeader>
</CORSRule>
</CORSConfiguration>
-
- Launch terminal at root of the repository and run
python backend/backend-server.py
- Launch terminal at root of the repository and run
-
- Open browser at
http:https://localhost:8080/client/test.html
in Chrome and upload a file
- Open browser at
-
- The console doesn't report any CORS errors and the file should be in your bucket.
-
- Do the same in FireFox, and notice the following CORS issue in the console
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://sos.exo.io/XXXX. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
- Do the same in FireFox, and notice the following CORS issue in the console
Adding <AllowedHeader>Access-Control-Allow-Origin</AllowedHeader>
to configuration doesn't help.