Skip to content

Instantly share code, notes, and snippets.

@saschagehlich
Created October 25, 2010 16:55
Show Gist options
  • Save saschagehlich/645295 to your computer and use it in GitHub Desktop.
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:
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
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