Commit 9c4b2217 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge pull request #4806 from ethereum-optimism/willc/body-parser-options

allow body parser options to be passed in
parents 5330243f 64df3c77
---
'@eth-optimism/common-ts': minor
---
Add option to configure body parser
...@@ -124,6 +124,7 @@ export abstract class BaseServiceV2< ...@@ -124,6 +124,7 @@ export abstract class BaseServiceV2<
metricsSpec: MetricsSpec<TMetrics> metricsSpec: MetricsSpec<TMetrics>
options?: Partial<TOptions & StandardOptions> options?: Partial<TOptions & StandardOptions>
loop?: boolean loop?: boolean
bodyParserParams?: bodyParser.OptionsJson
} }
) { ) {
this.loop = params.loop !== undefined ? params.loop : true this.loop = params.loop !== undefined ? params.loop : true
...@@ -330,6 +331,7 @@ export abstract class BaseServiceV2< ...@@ -330,6 +331,7 @@ export abstract class BaseServiceV2<
verify: (req, res, buf, encoding) => { verify: (req, res, buf, encoding) => {
;(req as any).rawBody = buf?.toString(encoding || 'utf8') || '' ;(req as any).rawBody = buf?.toString(encoding || 'utf8') || ''
}, },
...(this.params.bodyParserParams ?? {}),
}) })
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment