From c15e4faa226f07b3da5dc05f4627a99326aace5a Mon Sep 17 00:00:00 2001 From: p-young Date: Wed, 10 Jun 2020 22:23:03 -0700 Subject: [PATCH] Fix onRequest handler return type to allow promises (async) --- src/function-builder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/function-builder.ts b/src/function-builder.ts index 580e0498b..0ff075a33 100644 --- a/src/function-builder.ts +++ b/src/function-builder.ts @@ -157,7 +157,10 @@ export class FunctionBuilder { * same signature as an Express app. */ onRequest: ( - handler: (req: https.Request, resp: express.Response) => void + handler: ( + req: https.Request, + resp: express.Response + ) => void | Promise ) => https._onRequestWithOptions(handler, this.options), /** * Declares a callable method for clients to call using a Firebase SDK.