File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -28,3 +28,16 @@ export {http, cloudevent} from './function_registry';
2828
2929// Call the main method to load the user code and start the http server.
3030main ( ) ;
31+
32+ // We annotate the express Request with a rawBody field.
33+ // Express leaves the Express namespace open to allow merging of new fields.
34+ declare global {
35+ namespace Express {
36+ export interface Request {
37+ /**
38+ * A buffer which contains the request's raw HTTP body.
39+ */
40+ rawBody ? : Buffer ;
41+ }
42+ }
43+ }
Original file line number Diff line number Diff line change @@ -24,17 +24,6 @@ import * as http from 'http';
2424import { FUNCTION_STATUS_HEADER_FIELD } from './types' ;
2525import { sendCrashResponse } from './logger' ;
2626
27- // We optionally annotate the express Request with a rawBody field.
28- // Express leaves the Express namespace open to allow merging of new fields.
29- declare global {
30- // eslint-disable-next-line @typescript-eslint/no-namespace
31- namespace Express {
32- export interface Request {
33- rawBody ?: Buffer ;
34- }
35- }
36- }
37-
3827/**
3928 * Response object for the most recent request.
4029 * Used for sending errors to the user.
You can’t perform that action at this time.
0 commit comments