Skip to content

Commit

Permalink
Merge pull request #630 from gavinuhma/auth-fix
Browse files Browse the repository at this point in the history
set Access-Control-Allow-Origin header to origin to enable withCredentials
  • Loading branch information
rauchg committed Nov 22, 2011
2 parents 5ee6b43 + 61e7e89 commit 17d0f4d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,11 +727,8 @@ Manager.prototype.handleHandshake = function (data, req, res) {

if (origin) {
// https://developer.mozilla.org/En/HTTP_Access_Control
headers['Access-Control-Allow-Origin'] = '*';

if (req.headers.cookie) {
headers['Access-Control-Allow-Credentials'] = 'true';
}
headers['Access-Control-Allow-Origin'] = origin;
headers['Access-Control-Allow-Credentials'] = 'true';
}

this.authorize(handshakeData, function (err, authorized, newData) {
Expand Down

0 comments on commit 17d0f4d

Please sign in to comment.