diff --git a/src/index.ts b/src/index.ts index b63ec59..759ab4c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,6 +29,7 @@ type HttpLambdaConfig< H extends string > = { body: D.Decoder + rawBody?: string queryparams?: SchemaRecord headers?: SchemaRecord envSchema?: SchemaRecord @@ -179,11 +180,13 @@ export const _httpLambda = ( handler: ({ body, + rawBody, queryparams, headers, env, }: { body: A + rawBody: string queryparams: Record | undefined headers: Record | undefined env: Record | undefined @@ -217,6 +220,7 @@ export const _httpLambda = const handlerTask = pipe( taskEither.Do, taskEither.bind('body', () => parsedBody), + taskEither.bind('rawBody', () => taskEither.of(event.body || '')), taskEither.bind('env', () => config.envSchema ? parseSchemaRecord( @@ -384,6 +388,7 @@ export const getHttpLambda = < return _httpLambda(Sentry.AWSLambda.wrapHandler)(i) as unknown as ( f: (i: { body: A + rawBody?: string env: Record | undefined headers: Record | undefined queryparams: Record | undefined