J'utilisais withCredentials: true
sur mon appel $http
pour envoyer l'ID de session dans les en-têtes de demande.
Mais je faisais face:
"the value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'null' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute."
Alors j'ai changé CORS filtre côté serveur à:
response.setHeader("Access-Control-Allow-Origin", "http://localhost:8080/");
Maintenant, je reçois cette erreur:
"The 'Access-Control-Allow-Origin' header has a value ' http://localhost:8080 ' that is not equal to the supplied origin. Origin 'null' is therefore not allowed access."
Quelqu'un peut-il s'il vous plaît dites-moi la solution?
Vous pouvez renvoyer la valeur de l'en-tête de demande d'origine à Access-Control-Allow-Origin: 'response.setHeader (" Accès-Contrôle-Autoriser-Origine ", request.getHeader (" Origine ")); ' – sideshowbarker