DarrenOfficial / dpaste

The Django project driving dpaste.org
https://dpaste.org
MIT License
541 stars 124 forks source link

CORS problems make this unusable via javascript #225

Closed beyarkay closed 1 year ago

beyarkay commented 1 year ago

Description

Currently I can't fetch a paste that I POST to dpaste because the CORS header's aren't set to allow any origin. It would be amazing if I could POST a paste to dpaste, and then access that paste from a website I'm building.

Acceptance Criteria

This would be fixed if I can go into my browser and execute:

fetch('https://dpaste.org/KQn3b')

And not get an error message like:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://dpaste.org/KQn3b. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource. 
DarrenOfficial commented 1 year ago

Hello, I've added a CORS header set to allow any origin.

Please check if that resolved the issue for you.

beyarkay commented 1 year ago

Thanks so much!