XMLHttpRequest from origin 'http://127.0.0.1:8080' has been blocked by CORS policy
See original GitHub issueHi @mullermarian, I have been stuck a while with a security problem from the Web UI.
Describe the bug No way to load successfully the Web UI and use STUdio. Some error messages are on the screen and the Web UI doesn’t load the locales
Looks like the same closed issue #9
To Reproduce Nothing special, just follow the Readme and the right requirements. Launch the script and load the Web UI through Firefox or Chrome in their lastest versions.
Screenshots
Logs from the Chrome DevTools
(index):1 Access to XMLHttpRequest at 'http://localhost:8080/locales/en/translation.json' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. localhost:8080/locales/en/translation.json:1 Failed to load resource: net::ERR_FAILED (index):1 Access to XMLHttpRequest at 'http://localhost:8080/locales/fr/translation.json' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. App.js:49 Setting up vert.x event bus... localhost:8080/locales/fr/translation.json:1 Failed to load resource: net::ERR_FAILED (index):1 Access to fetch at 'http://localhost:8080/api/device/infos' from origin 'http://127.0.0.1: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. localhost:8080/api/device/infos:1 Failed to load resource: net::ERR_FAILED
Desktop and environment
- OS: Windows 10 1909 x64
- Browser Chrome v81 x64 & Firefox 75 x64
- Java version: JDK 11+
- STUdio application version 0.1.13
Additional context Script hosted locally on Windows 10 or on a remote Linux Server. Same issue from a client web browser in Windows 10.
Solution Temporary solution found : disable web security when startup Chrome
Launch Chrome from CMD without web security 👍
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=%UserProfile%
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
I think that if you enter in your web navigator http://localhost:8080/ (as described in the readme) instead of http://127.0.0.1:8080/ it will works 😃
I’ll try to improve this at some point, but tbh that’s pretty low priority.