A
A
Artem Nanavov2020-02-02 18:31:38
React
Artem Nanavov, 2020-02-02 18:31:38

React CORS issue?

Hi everyone, I'm making a get request to api - gallery.dev.webant.ru/api/photos?new=true, but it throws out CORS, I googled it but didn't understand what I need to DO EXACTLY to remove CORS, well, it throws an error (no access to back end)
5e36eb57898c8592034910.jpeg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mikhail Osher, 2020-02-02
@miraage

Is your backend? It is impossible to return origins separated by commas. Either a static address, or give what is in the Origin request header.
If not yours, then make some kind of proxy, either chrome + disable web security or firefox + cors everywhere.

F
fallus, 2020-02-03
@fallus

Or, if you're on a LAN, then open Chrome (for example) in unsafe mode.
For windows:
chrome.exe --disable-web-security --user-data-dir="c:/www"
--user-data-dir — folder where Chrome's temporary files will be stored.
If not windows, then everything is here:
https://stackoverflow.com/questions/35432749/disab...
And if not Chrome, then I did not take it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question