Skip to content

Commit

Permalink
Use raw headers instead parsed.
Browse files Browse the repository at this point in the history
Set-Cookie headers are parsed into single header with cookies in array.
This messes up the Set-Cookie headers, because browser receives multiple Set-Cookie headers as single with cookies separted with comma.
  • Loading branch information
ArGGu authored and jcrugzz committed Aug 30, 2015
1 parent 931f73d commit 8bfd90c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/http-proxy/passes/ws-incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ var passes = exports;
if (proxyHead && proxyHead.length) proxySocket.unshift(proxyHead);

socket.write('HTTP/1.1 101 Switching Protocols\r\n');
socket.write(Object.keys(proxyRes.headers).map(function(i) {
return i + ": " + proxyRes.headers[i];
socket.write(proxyRes.rawHeaders.map(function(v, i, a) {
return !(i % 2) ? v + ": " + a[i+1] : null;
}).filter(function (v) {
return v ? true : false;
}).join('\r\n') + '\r\n\r\n');
proxySocket.pipe(socket).pipe(proxySocket);

Expand Down

0 comments on commit 8bfd90c

Please sign in to comment.