Skip to content

nestjs/[email protected] breaks :param in globalPrefix #9776

@minju-s

Description

@minju-s

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When setting a parameter in app.setGlobalPrefix(':prefix') it is only available in a controller and not in a middleware.
In version 8.4.0 it works in the middleware too. You can test it if you set 8.4.0 manually in the package.json.

Minimum reproduction code

https://github.com/minju-s/nestjs-global-prefix-test

Steps to reproduce

  1. npm ci
  2. npm start
  3. goto http://localhost:3000/test/app
  4. console outputs undefined

Expected behavior

  1. npm ci
  2. npm start
  3. goto http://localhost:3000/test/app
  4. console outputs test

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

No response

NestJS version

8.4.1

Packages versions

"@nestjs/core": "8.4.1"

Node.js version

16.15.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions