Vasily Scherbakov
05/23/2021, 12:28 PMAccess to fetch at '<http://127.0.0.1:8080/api/run?userId=root&profile=test>' from origin '<http://localhost:3000>' 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. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled
As i understand, i should add origin to list of allowed origins in my backend app, i do this that way
install(CORS){
method(HttpMethod.Get)
method(<http://HttpMethod.Post|HttpMethod.Post>, )
method(HttpMethod.Delete)
anyHost()
host("localhost")
}
But this dont work.
This is headers of response from js clinet
'Origin': '<http://localhost:3000>',
'Content-Type': 'application/json',
'Accept': 'application/json',
'Access-Control-Request-Headers': 'Content-Type, Authorization'
Can anyone help me please?asad.awadia
05/23/2021, 10:46 PMandylamax
05/24/2021, 7:09 AM