This repository was archived by the owner on May 10, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,6 @@ const callbackHandler = (callback) =>
26
26
} ;
27
27
28
28
exports . handler = ( event , context , callback ) => {
29
- // Enable support for base64 encoding.
30
- // This is used by next-aws-lambda to determine whether to encode the response
31
- // body as base64.
32
- if ( ! process . env . hasOwnProperty ( "BINARY_SUPPORT" ) ) {
33
- process . env . BINARY_SUPPORT = "yes" ;
34
- }
35
-
36
29
// x-forwarded-host is undefined on Netlify for proxied apps that need it
37
30
// fixes https://github.com/netlify/next-on-netlify/issues/46
38
31
if ( ! event . multiValueHeaders . hasOwnProperty ( "x-forwarded-host" ) ) {
Original file line number Diff line number Diff line change @@ -7,9 +7,8 @@ const queryString = require("querystring");
7
7
const http = require ( "http" ) ;
8
8
9
9
const reqResMapper = ( event , callback ) => {
10
- const base64Support = process . env . BINARY_SUPPORT === "yes" ;
11
10
const response = {
12
- isBase64Encoded : base64Support ,
11
+ isBase64Encoded : true ,
13
12
multiValueHeaders : { } ,
14
13
} ;
15
14
let responsePromise ;
@@ -116,9 +115,7 @@ const reqResMapper = (event, callback) => {
116
115
}
117
116
118
117
if ( response . body ) {
119
- response . body = Buffer . from ( response . body ) . toString (
120
- base64Support ? "base64" : undefined
121
- ) ;
118
+ response . body = Buffer . from ( response . body ) . toString ( "base64" ) ;
122
119
}
123
120
response . multiValueHeaders = res . headers ;
124
121
res . writeHead ( response . statusCode ) ;
You can’t perform that action at this time.
0 commit comments