Skip to content

Commit

Permalink
Add debug log for pathname mismatch
Browse files Browse the repository at this point in the history
closes #840
  • Loading branch information
kennethtxytqw authored and dougwilson committed Jan 28, 2024
1 parent 408229e commit 991b7ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions HISTORY.md
@@ -1,6 +1,7 @@
unreleased
==========

* Add debug log for pathname mismatch
* Add `partitioned` to `cookie` options
* Add `priority` to `cookie` options
* Fix handling errors from setting cookie
Expand Down
6 changes: 5 additions & 1 deletion index.js
Expand Up @@ -193,7 +193,11 @@ function session(options) {

// pathname mismatch
var originalPath = parseUrl.original(req).pathname || '/'
if (originalPath.indexOf(cookieOptions.path || '/') !== 0) return next();
if (originalPath.indexOf(cookieOptions.path || '/') !== 0) {
debug('pathname mismatch')
next()
return
}

// ensure a secret is available or bail
if (!secret && !req.secret) {
Expand Down

0 comments on commit 991b7ee

Please sign in to comment.