File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/open-next/src/overrides/proxyExternalRequest Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -47,19 +47,19 @@ const nodeProxy: ProxyExternalRequest = {
4747 rejectUnauthorized : false ,
4848 } ,
4949 ( _res ) => {
50+ const resHeaders = _res . headers ;
5051 const nodeReadableStream =
51- _res . headers [ "content-encoding" ] === "br"
52+ resHeaders [ "content-encoding" ] === "br"
5253 ? _res . pipe ( require ( "node:zlib" ) . createBrotliDecompress ( ) )
53- : _res . headers [ "content-encoding" ] === "gzip"
54+ : resHeaders [ "content-encoding" ] === "gzip"
5455 ? _res . pipe ( require ( "node:zlib" ) . createGunzip ( ) )
5556 : _res ;
56-
5757 const isBase64Encoded =
58- isBinaryContentType ( headers [ "content-type" ] ) ||
59- ! ! headers [ "content-encoding" ] ;
58+ isBinaryContentType ( resHeaders [ "content-type" ] ) ||
59+ ! ! resHeaders [ "content-encoding" ] ;
6060 const result : InternalResult = {
6161 type : "core" ,
62- headers : filterHeadersForProxy ( _res . headers ) ,
62+ headers : filterHeadersForProxy ( resHeaders ) ,
6363 statusCode : _res . statusCode ?? 200 ,
6464 // TODO: check base64 encoding
6565 isBase64Encoded,
You can’t perform that action at this time.
0 commit comments