Skip to content

Commit

Permalink
Figured out a less hackish way to point to the unpatched setHeader fu…
Browse files Browse the repository at this point in the history
…nction
  • Loading branch information
mtkopone committed Nov 24, 2012
1 parent 762a836 commit e3b1247
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cookies.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var http = require('http')
var cache = {}

function Cookies(request, response, keys) {
Expand Down Expand Up @@ -58,7 +59,7 @@ Cookies.prototype = {
headers = pushCookie(headers, cookie)
}

var setHeader = res.set ? res.__proto__.__proto__.__proto__.__proto__.setHeader : res.setHeader
var setHeader = res.set ? http.OutgoingMessage.prototype.setHeader : res.setHeader
setHeader.call(res, 'set-cookie', headers)
return this
}
Expand Down

0 comments on commit e3b1247

Please sign in to comment.