Comparing version 0.2.10 to 0.2.11
@@ -50,3 +50,3 @@ 'use strict'; | ||
try { | ||
return JSON.parse(payload.serverless.aws.event.body); | ||
return JSON.parse(request.rawBody); | ||
} catch (error) { | ||
@@ -56,2 +56,5 @@ console.warn('Unable to parse request body as json: ' + error.message); | ||
} | ||
return request.rawBody; | ||
}, | ||
get rawBody() { | ||
return payload.serverless.aws.event.body; | ||
@@ -58,0 +61,0 @@ }, |
{ | ||
"name": "arnie", | ||
"version": "0.2.10", | ||
"version": "0.2.11", | ||
"description": "Action hero for backends", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -40,3 +40,3 @@ const net = require('net') | ||
try { | ||
return JSON.parse(payload.serverless.aws.event.body) | ||
return JSON.parse(request.rawBody) | ||
} catch (error) { | ||
@@ -46,2 +46,5 @@ console.warn(`Unable to parse request body as json: ${error.message}`) | ||
} | ||
return request.rawBody | ||
}, | ||
get rawBody () { | ||
return payload.serverless.aws.event.body | ||
@@ -48,0 +51,0 @@ }, |
@@ -9,3 +9,3 @@ const test = require('tape') | ||
test('Provider: ServerlessRequest', (t) => { | ||
t.plan(9) | ||
t.plan(10) | ||
@@ -57,2 +57,3 @@ const payload = { | ||
t.deepEqual(request.body, {foo: 'BAR', bar: 123}, 'should parse a json body') | ||
t.equal(request.rawBody, '{\n\t"foo": "BAR",\n\t"bar": 123\n}', 'should provide raw body') | ||
} | ||
@@ -59,0 +60,0 @@ ], payload) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
171055
3943