File tree Expand file tree Collapse file tree
packages/platform-fastify/adapters Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
1212 CorsOptionsDelegate ,
1313} from '@nestjs/common/interfaces/external/cors-options.interface' ;
1414import { loadPackage } from '@nestjs/common/utils/load-package.util' ;
15- import { isUndefined , isString } from '@nestjs/common/utils/shared.utils' ;
15+ import { isString , isUndefined } from '@nestjs/common/utils/shared.utils' ;
1616import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter' ;
1717import {
1818 fastify ,
@@ -422,10 +422,13 @@ export class FastifyAdapter<
422422 await this . registerMiddie ( ) ;
423423 }
424424 return ( path : string , callback : Function ) => {
425- const normalizedPath = path . endsWith ( '/*' )
425+ let normalizedPath = path . endsWith ( '/*' )
426426 ? `${ path . slice ( 0 , - 1 ) } (.*)`
427427 : path ;
428428
429+ // Fallback to "(.*)" to support plugins like GraphQL
430+ normalizedPath = normalizedPath === '/(.*)' ? '(.*)' : normalizedPath ;
431+
429432 // The following type assertion is valid as we use import('middie') rather than require('middie')
430433 // ref https://github.com/fastify/middie/pull/55
431434 this . instance . use (
You can’t perform that action at this time.
0 commit comments