express-session
Advanced tools
Comparing version 1.15.4 to 1.15.5
@@ -0,1 +1,8 @@ | ||
1.15.5 / 2017-08-02 | ||
=================== | ||
* Fix `TypeError` when `req.url` is an empty string | ||
* deps: depd@~1.1.1 | ||
- Remove unnecessary `Buffer` loading | ||
1.15.4 / 2017-07-18 | ||
@@ -2,0 +9,0 @@ =================== |
@@ -194,3 +194,3 @@ /*! | ||
// pathname mismatch | ||
var originalPath = parseUrl.original(req).pathname; | ||
var originalPath = parseUrl.original(req).pathname || '/' | ||
if (originalPath.indexOf(cookieOptions.path || '/') !== 0) return next(); | ||
@@ -197,0 +197,0 @@ |
{ | ||
"name": "express-session", | ||
"version": "1.15.4", | ||
"version": "1.15.5", | ||
"description": "Simple session middleware for Express", | ||
@@ -17,3 +17,3 @@ "author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)", | ||
"debug": "2.6.8", | ||
"depd": "~1.1.0", | ||
"depd": "~1.1.1", | ||
"on-headers": "~1.0.1", | ||
@@ -42,6 +42,6 @@ "parseurl": "~1.3.1", | ||
"scripts": { | ||
"test": "mocha --bail --reporter spec test/", | ||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/", | ||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec test/" | ||
"test": "mocha --check-leaks --bail --no-exit --reporter spec test/", | ||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --no-exit --reporter dot test/", | ||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --no-exit --reporter spec test/" | ||
} | ||
} |
@@ -295,11 +295,10 @@ # express-session | ||
app.get('/', function(req, res, next) { | ||
var sess = req.session | ||
if (sess.views) { | ||
sess.views++ | ||
if (req.session.views) { | ||
req.session.views++ | ||
res.setHeader('Content-Type', 'text/html') | ||
res.write('<p>views: ' + sess.views + '</p>') | ||
res.write('<p>expires in: ' + (sess.cookie.maxAge / 1000) + 's</p>') | ||
res.write('<p>views: ' + req.session.views + '</p>') | ||
res.write('<p>expires in: ' + (req.session.cookie.maxAge / 1000) + 's</p>') | ||
res.end() | ||
} else { | ||
sess.views = 1 | ||
req.session.views = 1 | ||
res.end('welcome to the session demo. refresh!') | ||
@@ -718,6 +717,4 @@ } | ||
app.use(function (req, res, next) { | ||
var views = req.session.views | ||
if (!views) { | ||
views = req.session.views = {} | ||
if (!req.session.views) { | ||
req.session.views = {} | ||
} | ||
@@ -729,3 +726,3 @@ | ||
// count the views | ||
views[pathname] = (views[pathname] || 0) + 1 | ||
req.session.views[pathname] = (req.session.views[pathname] || 0) + 1 | ||
@@ -732,0 +729,0 @@ next() |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /*! |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69303
752
Updateddepd@~1.1.1