Hey, Access to fetch at '<https://wallpaperaccess...
# compose-web
k
Hey, Access to fetch at '

https://wallpaperaccess.com/full/3954838.jpg

' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. Facing this while making GET request to a url. How to set ktors request mode to no-cors ?
h
CORS is a server side security feature enforced by the browser without an option to disable it.
k
So what to do here
h
It really depends on your architecture. Just read https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS first.
a
Have you tried reading the docs? https://ktor.io/docs/cors.html
b
Just place https://corsproxy.io/? before the url. For example, https://corsproxy.io/?https:<//wallpaperaccess.com/full/3954838.jpg>
❤️ 1
k
isn't there any way without using 3rd party like this, what is it's reliability ?
??? Don't get it
b
@Kapil Yadav There are other ways to handle CORS, You can deploy a firebase function or use CloudFlare workers. For a small project you can just use corsproxy