socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true when opening http://socket.io/docs/logging-and-debugging/ in Chrome

Open wang3g opened this issue 10 years ago • 2 comments

Hi, When I open http://socket.io/docs/logging-and-debugging/ in Chrome, I got the following errors:

XMLHttpRequest cannot load http://slack.socket.io/socket.io/?EIO=3&transport=polling&t=LB9FyqP. A wildcard '' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://socket.io' is therefore not allowed access.(index):1 XMLHttpRequest cannot load http://slack.socket.io/socket.io/?EIO=3&transport=polling&t=LB9F-5X. A wildcard '' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://socket.io' is therefore not allowed access.(index):1 ...

There is no such error when the page is opened in Chrome Incogonito, Safari and Firefox browsers. The reason I raised this issue is because my own site has the exactly same issue. Please help.

Thanks, Jack

wang3g avatar Feb 10 '16 03:02 wang3g

Important note: when responding to a credentialed request, server must specify a domain, and cannot use wild carding. The above example would fail if the header was wildcarded as: Access-Control-Allow-Origin: *.

  • https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials

okko avatar Feb 23 '16 07:02 okko

That issue was closed automatically. Please check if your issue is fixed with the latest release, and reopen if needed (with a fiddle reproducing the issue if possible).

darrachequesne avatar Jan 12 '17 15:01 darrachequesne