File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,13 @@ export function getServer(
136136 }
137137 if ( options . ignoredRoutes !== null ) {
138138 // Ignored routes is a configuration option that allows requests to specific paths to be prevented
139- // from invoking the user's function.
140- app . use ( options . ignoredRoutes , ( req , res ) => {
141- res . status ( 404 ) . send ( null ) ;
142- } ) ;
139+ // from invoking the user's function. An empty string indicates that no routes should be filtered.
140+ if ( options . ignoredRoutes . trim ( ) !== '' ) {
141+ // Any non-empty string is the used a route expression to return 404 for.
142+ app . use ( options . ignoredRoutes , ( req , res ) => {
143+ res . status ( 404 ) . send ( null ) ;
144+ } ) ;
145+ }
143146 } else if ( options . signatureType === 'http' ) {
144147 // We configure some default ignored routes, only for HTTP functions.
145148 app . use ( '/favicon.ico|/robots.txt' , ( req , res ) => {
You can’t perform that action at this time.
0 commit comments