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 {
7676 // When using HEAD requests, it seems that flushHeaders is not called, not sure why
7777 // Probably some kind of race condition
7878 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" ] ;
8482 // We cannot convert the OpenNextNodeResponse to a ReadableStream directly
8583 // You can look in the `aws-lambda.ts` file for some context
8684 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 = (
1212 if ( value === undefined ) {
1313 continue ;
1414 } else {
15- result [ key ] = convertHeader ( value ) ;
15+ result [ key . toLowerCase ( ) ] = convertHeader ( value ) ;
1616 }
1717 }
1818
You can’t perform that action at this time.
0 commit comments