diff --git a/lib/serve.js b/lib/serve.js index 0f6bb69c..878525b6 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -35,7 +35,7 @@ function createHandler(dir) { httpMethod: request.method, queryStringParameters: request.query, headers: request.headers, - body: isBase64 ? request.body : base64.encode(request.body), + body: isBase64 ? base64.encode(request.body) : request.body, isBase64Encoded: isBase64 }; @@ -63,6 +63,7 @@ exports.listen = function(port) { var app = express(); var dir = config.build.functions || config.build.Functions; app.use(bodyParser.raw()); + app.use(bodyParser.text({type: "*/*"})); app.use(expressLogging(console)); app.all("*", createHandler(dir));