$http
コールでwithCredentials: true
を使用していましたが、要求ヘッダーでセッションIDを送信しました。
しかし、私は直面していた:
"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."
をだから私はにサーバー側で私のCORSフィルターを変更:
response.setHeader("Access-Control-Allow-Origin", "http://localhost:8080/");
今、私はこのエラーを取得しています:
"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."
ことができます誰も解決策を教えてください?
元のリクエストヘッダーの値をAccess-Control-Allow-Originに戻すことができます。 'response.setHeader(" Access-Control-Allow-Origin "、request.getHeader(" Origin ")); ' – sideshowbarker