mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Use raw headers instead parsed.
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.
This commit is contained in:
parent
931f73dc98
commit
8bfd90c4d9
@ -114,8 +114,10 @@ var passes = exports;
|
|||||||
if (proxyHead && proxyHead.length) proxySocket.unshift(proxyHead);
|
if (proxyHead && proxyHead.length) proxySocket.unshift(proxyHead);
|
||||||
|
|
||||||
socket.write('HTTP/1.1 101 Switching Protocols\r\n');
|
socket.write('HTTP/1.1 101 Switching Protocols\r\n');
|
||||||
socket.write(Object.keys(proxyRes.headers).map(function(i) {
|
socket.write(proxyRes.rawHeaders.map(function(v, i, a) {
|
||||||
return i + ": " + proxyRes.headers[i];
|
return !(i % 2) ? v + ": " + a[i+1] : null;
|
||||||
|
}).filter(function (v) {
|
||||||
|
return v ? true : false;
|
||||||
}).join('\r\n') + '\r\n\r\n');
|
}).join('\r\n') + '\r\n\r\n');
|
||||||
proxySocket.pipe(socket).pipe(proxySocket);
|
proxySocket.pipe(socket).pipe(proxySocket);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user