Skip to content

Commit aa37fa6

Browse files
committed
handle base64 encoded body
1 parent ea6d4cc commit aa37fa6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Plugins/VercelPackager/Server/server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ const server = http.createServer(async (req, res) => {
5454
const body = await readBody(req)
5555
const _res = await invoke({ method, path, headers, body })
5656
const _body = JSON.parse(await readBody(_res))
57+
console.log(_body)
5758
res.writeHead(_body.statusCode, _body.headers)
58-
res.end(_body.body)
59+
res.end(Buffer.from(_body.body || '', _body.isBase64Encoded ? 'base64' : 'utf8'))
5960
} catch (err) {
6061
console.error(err)
6162
res.writeHead(500, {})

0 commit comments

Comments
 (0)