-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't download image due to CORS policy, though server replies with Access-Control-Allow-Origin: * #1549
Comments
I read #1354 but it does not solve the problem |
Have a read of my blog, particularly on preflight requests. In short, having The server should respond to the preflight request by giving no content body e.g. I tested the url in your example and I see it giving
In your EDIT: I forgot to update the The reason why I do it that way is I've previously had issues using the wildcard on older iOS devices (like iOS 9 or 10... devices that aren't actually supported anymore) |
Thank you very much @breautek , I will check it out this evening |
I could solve the problem using the const cors = require('cors')
const app = express()
app.use(cors())
app.use('/image_server', express.static(path.join(__dirname, 'uploadedImages'))) I don't know why but NPM express package Thank you very much @breautek anyway |
Doesn't really matter what HTTP technology you use, just as long as it responds to So if you're using Node with express, then the |
Bug Report
Problem
What is expected to happen?
Be able to download an image with
fetch()
considering the server replies withAccess-Control-Allow-Origin: *
This image. As you can see here, the
Access-Control-Allow-Origin
header is*
What does actually happen?
CORS policy blocks the HTTP request
Information
Command or Code
In console of the Chrome dev tools, I typed:
fetch('https://servidor.nomeubairro.app/image_server/debug_n1_2023_01_21_22_11_abrantes_bemposta_gfzsowzdap.jpg')
Environment, Platform, Device
Version information
cordova info
:Checklist
The text was updated successfully, but these errors were encountered: