ConnectProject / mavoix-panel

0 stars 1 forks source link

CORS issue when uploading a file for which the name needs to be changed #60

Open ntraut opened 3 years ago

ntraut commented 3 years ago

It is an issue which only happens when the Parse API is not on the same host as mavoix-panel. When we try to upload an image for which the name has special characters so it has to be changed (Parse only allows alpha-numeric characters, dash, underscore and period), the upload fails with the error:

Access to XMLHttpRequest at 'https://ghfc17.hosting.pasteur.fr/parse/files/test_with-random_name%20_mod_.png' from origin 'https://mavoix.connect-project.io' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

When the file has only valid characters we do not have this problem. I'm not sure if it is a configuration which is missing somewhere or an issue in Parse. I tried to update Parse to its newest version but the error is still there.

ntraut commented 3 years ago

Now that we no longer use the ghfc17 address but only the https://mavoix.connect-project.io address, this problem may be no longer an issue.