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
- Fix TypeError when req.url is an empty string fixes #495 — committed to nodew/session by dougwilson 7 years ago
Well, thinking about it, probably this would be the fix:
If no
pathname
, then callnext()
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 andnext()
if not prefixing.