File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @opennextjs/aws " : patch
3
+ ---
4
+
5
+ Fix response binary content handling
Original file line number Diff line number Diff line change @@ -76,11 +76,9 @@ export function convertRes(res: OpenNextNodeResponse): InternalResult {
76
76
// When using HEAD requests, it seems that flushHeaders is not called, not sure why
77
77
// Probably some kind of race condition
78
78
const headers = parseHeaders ( res . getFixedHeaders ( ) ) ;
79
- const isBase64Encoded = isBinaryContentType (
80
- Array . isArray ( headers [ "content-type" ] )
81
- ? headers [ "content-type" ] [ 0 ]
82
- : headers [ "content-type" ] ,
83
- ) ;
79
+ const isBase64Encoded =
80
+ isBinaryContentType ( headers [ "content-type" ] ) ||
81
+ ! ! headers [ "content-encoding" ] ;
84
82
// We cannot convert the OpenNextNodeResponse to a ReadableStream directly
85
83
// You can look in the `aws-lambda.ts` file for some context
86
84
const body = Readable . toWeb ( Readable . from ( res . getBody ( ) ) ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export const parseHeaders = (
12
12
if ( value === undefined ) {
13
13
continue ;
14
14
} else {
15
- result [ key ] = convertHeader ( value ) ;
15
+ result [ key . toLowerCase ( ) ] = convertHeader ( value ) ;
16
16
}
17
17
}
18
18
You can’t perform that action at this time.
0 commit comments