Skip to content

Possible regression from 8.4.0 changes regarding req.baseUrl in Express #430

@Will956

Description

@Will956

Hey,

I was looking to update my path-to-regexp occurrences in my pnpm-lock.yaml but noticed some unintended (maybe?) changes.

I'm using NestJS with ExpressJS under the hood, ExpressJS uses router package that uses path-to-regexp. When I bump to 8.4.0 using
pnpm update path-to-regexp --lockfile-only -r, I just noticed that req.baseUrl does not return the full path from the URL but only the first level one.

Before 8.4.0,
http://localhost:3000/path1/path2

console.log(req.baseUrl)
> /path1/path2

After 8.4.0,
http://localhost:3000/path1/path2

console.log(req.baseUrl)
> /path1

I'm not 100% sure of my findings, but does that ring a bell on your side? thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions