Answer the question
In order to leave comments, you need to log in
How to remove No 'Access-Control-Allow-Origin' from CORS if there is no question mark in the URL?
This is probably strange, but my cors gives an access error only if fetch in js has a URL without a question mark. CORS is set up and my Vue project has access to the server.
It won't let you:
fetch('http://back.ru/role').then(res => { return res.json() })
.then(data => { this.role = data.items });
fetch('http://back.ru/role?').then(res => { return res.json() })
.then(data => { this.role = data.items });
method: "GET"
http://back.ru/menu/4
Answer the question
In order to leave comments, you need to log in
In certain cases, the browser makes a preflight request . The resource is first requested using the OPTIONS method, which the browser expects to receive a 200 response with CORS headers set. And only if this request passed, then the main request is made.
Check that your server responds normally to OPTIONS.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question