Permalink
Browse files

res.socket is not always defined, check first before trying to read r…

…es.socket.encrypted
  • Loading branch information...
angelini committed Mar 15, 2012
1 parent 73d1481 commit e54b10e832d0d9e0a2146677615f5b66baeec29c
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/cookies.js
View
@@ -38,7 +38,7 @@ Cookies.prototype = {
var res = this.response
, req = this.request
, headers = res.getHeader( "Set-Cookie" ) || []
- , secure = res.socket.encrypted || req.connection.proxySecure
+ , secure = res.socket ? res.socket.encrypted || req.connection.proxySecure : req.connection.proxySecure
, cookie = new Cookie( name, value, opts )
, header

0 comments on commit e54b10e

Please sign in to comment.