From e3b12470ed7c6169c582bcd206325e64411c283e Mon Sep 17 00:00:00 2001 From: Mikko Koponen Date: Sat, 24 Nov 2012 17:03:06 +0200 Subject: [PATCH] Figured out a less hackish way to point to the unpatched setHeader function --- lib/cookies.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cookies.js b/lib/cookies.js index abfe2a3..a1e9c45 100644 --- a/lib/cookies.js +++ b/lib/cookies.js @@ -1,3 +1,4 @@ +var http = require('http') var cache = {} function Cookies(request, response, keys) { @@ -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 }