File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ async function getParams(
157157 )
158158 }
159159
160- return getBody ( context )
160+ return getBody ( context , debug )
161161 }
162162 } else {
163163 let params : any = { }
@@ -225,7 +225,7 @@ async function getParams(
225225 limit : BODY_SIZE_LIMIT
226226 } )
227227 } else {
228- const body = await getBody ( context )
228+ const body = await getBody ( context , debug )
229229 return JSON . parse ( body . toString ( 'utf8' ) )
230230 }
231231 } else {
@@ -240,14 +240,20 @@ async function getParams(
240240 }
241241}
242242
243- async function getBody ( context : HttpContext ) : Promise < Buffer > {
243+ async function getBody ( context : HttpContext , debug : boolean ) : Promise < Buffer > {
244244 const opts : any = { }
245245 const len = context . req . headers [ 'content-length' ]
246246 const encoding = context . req . headers [ 'content-encoding' ] || 'identity'
247247 if ( len && encoding === 'identity' ) {
248248 opts . length = + len
249249 opts . limit = BODY_SIZE_LIMIT
250250 }
251+
252+ if ( debug ) {
253+ console . log ( opts )
254+ console . log ( context . req . headers )
255+ }
256+
251257 return ( raw ( inflate ( context . req ) , opts ) as unknown ) as Promise < Buffer >
252258}
253259
You can’t perform that action at this time.
0 commit comments