File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,13 @@ export function getServer(
136
136
}
137
137
if ( options . ignoredRoutes !== null ) {
138
138
// 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
+ }
143
146
} else if ( options . signatureType === 'http' ) {
144
147
// We configure some default ignored routes, only for HTTP functions.
145
148
app . use ( '/favicon.ico|/robots.txt' , ( req , res ) => {
You can’t perform that action at this time.
0 commit comments