@@ -44,7 +44,7 @@ export function getServer(
4444 // Express middleware
4545
4646 // Set request-specific values in the very first middleware.
47- app.use('/* ', (req, res, next) => {
47+ app.use('/{*splat} ', (req, res, next) => {
4848 setLatestRes(res);
4949 res.locals.functionExecutionFinished = false;
5050 next();
@@ -136,7 +136,7 @@ export function getServer(
136136 }
137137 } else if (options.signatureType === 'http') {
138138 // We configure some default ignored routes, only for HTTP functions.
139- app.use('/favicon.ico| /robots.txt', (req, res) => {
139+ app.use([ '/favicon.ico', ' /robots.txt'] , (req, res) => {
140140 // Neither crawlers nor browsers attempting to pull the icon find the body
141141 // contents particularly useful, so we filter these requests out from invoking
142142 // the user's function by default.
@@ -145,7 +145,7 @@ export function getServer(
145145 }
146146
147147 if (options.signatureType === 'http') {
148- app.use('/* ', (req, res, next) => {
148+ app.use('/{*splat} ', (req, res, next) => {
149149 onFinished(res, (err, res) => {
150150 res.locals.functionExecutionFinished = true;
151151 });
@@ -158,9 +158,9 @@ export function getServer(
158158 // Set up the routes for the user's function
159159 const requestHandler = wrapUserFunction(userFunction, options.signatureType);
160160 if (options.signatureType === 'http') {
161- app.all('/* ', requestHandler);
161+ app.all('/{*splat} ', requestHandler);
162162 } else {
163- app.post('/* ', requestHandler);
163+ app.post('/{*splat} ', requestHandler);
164164 }
165165
166166 return http.createServer(app);
0 commit comments