Created
October 25, 2010 16:55
-
-
Save saschagehlich/645295 to your computer and use it in GitHub Desktop.
Since ClientResponse does only return the first Cookie in Set-Cookie, here is a workaround:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
old = HTTP.IncomingMessage.prototype._addHeaderLine | |
HTTP.IncomingMessage.prototype._addHeaderLine = (field, value) -> | |
if field is 'set-cookie' and @headers['set-cookie'] | |
@headers['set-cookie'] += "; #{value}" | |
else | |
old.apply this, arguments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
old = HTTP.IncomingMessage.prototype._addHeaderLine; | |
HTTP.IncomingMessage.prototype._addHeaderLine = function(field, value) { | |
return field === 'set-cookie' && this.headers['set-cookie'] ? this.headers['set-cookie'] += ("; " + (value)) : old.apply(this, arguments); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment