This repository was archived by the owner on Jan 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/libs/lambda-at-edge/src/routing Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,7 @@ const ignoredHeaders = [
65
65
"content-length" ,
66
66
"host" ,
67
67
"transfer-encoding" ,
68
- "via" ,
69
- "content-encoding"
68
+ "via"
70
69
] ;
71
70
72
71
const ignoredHeaderPrefixes = [ "x-amz-cf-" , "x-amzn-" , "x-edge-" ] ;
@@ -107,12 +106,14 @@ export async function createExternalRewriteResponse(
107
106
fetchResponse = await fetch ( customRewrite , {
108
107
headers : reqHeaders ,
109
108
method : req . method ,
110
- body : decodedBody // Must pass body as a string
109
+ body : decodedBody , // Must pass body as a string,
110
+ compress : false
111
111
} ) ;
112
112
} else {
113
113
fetchResponse = await fetch ( customRewrite , {
114
114
headers : reqHeaders ,
115
- method : req . method
115
+ method : req . method ,
116
+ compress : false
116
117
} ) ;
117
118
}
118
119
@@ -122,6 +123,5 @@ export async function createExternalRewriteResponse(
122
123
}
123
124
}
124
125
res . statusCode = fetchResponse . status ;
125
- const text = await fetchResponse . text ( ) ;
126
- res . end ( text ) ;
126
+ res . end ( await fetchResponse . buffer ( ) ) ;
127
127
}
You can’t perform that action at this time.
0 commit comments