Skip to content

Commit

Permalink
Merge pull request #3 from bcomnes/text-body
Browse files Browse the repository at this point in the history
Match AWS behavior with text content
  • Loading branch information
biilmann authored Jan 2, 2018
2 parents 797cae9 + c26230e commit 345ac91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 345ac91

Please sign in to comment.