question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTP Upload CORS error

See original GitHub issue

Hi, I am getting Cross-Origin Request Blocked in my browser console when trying sending files. I enabled CORS in my apache. (https://enable-cors.org/server_apache.html). I got the same error under the following conversejs version. 6.0.0 and 5.0.5.

Here are some screenshots of my firefox console.

Screenshot from 2020-01-13 08-58-32

Screenshot from 2020-01-13 08-58-58

Screenshot from 2020-01-13 08-59-16

Screenshot from 2020-01-13 08-59-44

Screenshot from 2020-01-13 08-59-47

I really don’t know what is going wrong.

Regards,

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
PIWALcommented, Jan 14, 2020

Thanks a lot @jcbrand. I just have to allow CORS in my ejabberd config. By adding the following code in mod_http_upload.

custom_headers:
   "Access-Control-Allow-Origin": "*"
   "Access-Control-Allow-Methods": "HEAD, PATCH, DELETE, PUT, GET, POST, DELETE, OPTIONS"
   "Access-Control-Allow-Headers": "Content-Type, Origin, X-Requested-With, Accept"

Regards,

0reactions
jcbrandcommented, Jan 14, 2020

Thanks for letting us know what fixed it for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CORS Fails when uploading a file - Stack Overflow
What I get. I get a message saying that the Access-Control-Allow-Origin header is missing but this header is allowed in my Cors. I...
Read more >
CORS issue with file uploading API - Box Support
I read somewhere that CORS error can occur because, your access token doesn't allow uploading to that folder, the folder Id doesn't have...
Read more >
Cors error when uploading file - Laracasts
Hello, i'm facing again the cors error when i'm trying to upload file with axios my cors.php : Copy Code <?php return [...
Read more >
File Upload/Download not working because of CORS policy
We have recently introduced versioning to our API. We have updated the url, uploadUrl and downloadUrl for the FileManager control.
Read more >
Using cross-origin resource sharing (CORS)
The subtopics describe how you can enable CORS using the Amazon S3 console, or programmatically by ... http://website.s3-website.us-east-1.amazonaws.com.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found