Skip to content

Commit

Permalink
remove unnecessary secured variable
Browse files Browse the repository at this point in the history
Match commit from senchalabs#824 for session.js
  • Loading branch information
fabslab committed Jul 4, 2013
1 parent c9ec00c commit 55f9d82
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/middleware/cookieSession.js
@@ -1,4 +1,3 @@

/*!
* Connect - cookieSession
* Copyright(c) 2011 Sencha Inc.
Expand Down Expand Up @@ -92,11 +91,10 @@ module.exports = function cookieSession(options){

// check security
var proto = (req.headers['x-forwarded-proto'] || '').toLowerCase()
, tls = req.connection.encrypted || (trustProxy && 'https' == proto.split(/\s*,\s*/)[0])
, secured = cookie.secure && tls;
, tls = req.connection.encrypted || (trustProxy && 'https' == proto.split(/\s*,\s*/)[0]);

// only send secure cookies via https
if (cookie.secure && !secured) return debug('not secured');
if (cookie.secure && !tls) return debug('not secured');

// serialize
debug('serializing %j', req.session);
Expand Down

0 comments on commit 55f9d82

Please sign in to comment.