cors - AngularJS $http call fails due to Access-Control-Allow-Origin -


i using withcredentials: true on $http call send session id in request headers.

but facing:

"the value of 'access-control-allow-origin' header in response must not wildcard '*' when request's credentials mode 'include'. origin 'null' therefore not allowed access. credentials mode of requests initiated xmlhttprequest controlled withcredentials attribute."

so changed cors filter on server side to:

response.setheader("access-control-allow-origin", "http://localhost:8080/"); 

now getting error:

"the 'access-control-allow-origin' header has value 'http://localhost:8080' not equal supplied origin. origin 'null' therefore not allowed access."

can please tell me solution?

try using snippet:

response.setheader("access-control-allow-origin", "*");


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -