Check for base64 encoding in netlify adapter.

This commit is contained in:
Dillon Kearns 2021-12-29 14:25:46 -08:00
parent 4444ef6fc0
commit f12b11ddb0

View File

@ -230,7 +230,12 @@ function reqToJson(req, requestTime) {
resolve(toJsonHelper(req, requestTime, fields)); resolve(toJsonHelper(req, requestTime, fields));
}); });
console.log('@@@4'); console.log('@@@4');
bb.write(req.body);
if (req.isBase64Encoded) {
bb.write(Buffer.from(req.body, 'base64').toString('utf8'));
} else {
bb.write(req.body);
}
} catch (error) { } catch (error) {
console.error('@@@5', error); console.error('@@@5', error);
resolve(toJsonHelper(req, requestTime, null)); resolve(toJsonHelper(req, requestTime, null));