session: Bug: Error on Google Cloud Functions

When used on Google Cloud Functions an error is thrown due to req.originalURL === "". The error is thrown from these 3 lines handling originalPath.

The debugging to find this bug can be found in this tweet thread with @blakeembrey

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Well, thinking about it, probably this would be the fix:

If no pathname, then call next() if the cookie path is set to anything other than '/' (the default). Since / would cover the entire domain anyway, checking the path is not useful. Otherwise, check the path and next() if not prefixing.