@felloh-org/lambda-wrapper 1.11.55 → 1.11.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/service/request.js +5 -4
- package/package.json +1 -1
package/dist/service/request.js
CHANGED
|
@@ -154,7 +154,6 @@ class Request extends _dependencyAware.default {
|
|
|
154
154
|
|
|
155
155
|
getAll(requestType = null) {
|
|
156
156
|
const event = this.getContainer().getEvent();
|
|
157
|
-
console.log(event);
|
|
158
157
|
|
|
159
158
|
if (HTTP_METHODS_WITHOUT_PAYLOADS.includes(event.httpMethod) || HTTP_METHODS_WITHOUT_PAYLOADS.includes(requestType)) {
|
|
160
159
|
// get simple parameters
|
|
@@ -170,7 +169,6 @@ class Request extends _dependencyAware.default {
|
|
|
170
169
|
if (HTTP_METHODS_WITH_PAYLOADS.includes(event.httpMethod) || HTTP_METHODS_WITH_PAYLOADS.includes(requestType)) {
|
|
171
170
|
const contentType = this.getHeader('Content-Type', this.getHeader('content-type'));
|
|
172
171
|
let queryParameters = {};
|
|
173
|
-
console.log('content-type', contentType);
|
|
174
172
|
|
|
175
173
|
if (contentType.includes('application/x-www-form-urlencoded')) {
|
|
176
174
|
queryParameters = _querystring.default.parse(event.body);
|
|
@@ -178,7 +176,11 @@ class Request extends _dependencyAware.default {
|
|
|
178
176
|
|
|
179
177
|
if (contentType.includes('application/json')) {
|
|
180
178
|
try {
|
|
181
|
-
|
|
179
|
+
if (typeof event.body) {
|
|
180
|
+
queryParameters = event.body;
|
|
181
|
+
} else {
|
|
182
|
+
queryParameters = JSON.parse(event.body);
|
|
183
|
+
}
|
|
182
184
|
} catch (error) {
|
|
183
185
|
console.log(error);
|
|
184
186
|
queryParameters = {};
|
|
@@ -262,7 +264,6 @@ class Request extends _dependencyAware.default {
|
|
|
262
264
|
if (typeof validation === 'undefined') {
|
|
263
265
|
resolve();
|
|
264
266
|
} else {
|
|
265
|
-
console.log(this.getAll(), validation);
|
|
266
267
|
Logger.label('request-validation-failed');
|
|
267
268
|
const validationErrorResponse = new _response.default({}, 422);
|
|
268
269
|
Object.keys(validation).forEach(validationKey => {
|