@felloh-org/lambda-wrapper 1.11.56 → 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 -6
- 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,17 +169,18 @@ 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);
|
|
177
175
|
}
|
|
178
176
|
|
|
179
|
-
console.log(typeof event.body);
|
|
180
|
-
|
|
181
177
|
if (contentType.includes('application/json')) {
|
|
182
178
|
try {
|
|
183
|
-
|
|
179
|
+
if (typeof event.body) {
|
|
180
|
+
queryParameters = event.body;
|
|
181
|
+
} else {
|
|
182
|
+
queryParameters = JSON.parse(event.body);
|
|
183
|
+
}
|
|
184
184
|
} catch (error) {
|
|
185
185
|
console.log(error);
|
|
186
186
|
queryParameters = {};
|
|
@@ -264,7 +264,6 @@ class Request extends _dependencyAware.default {
|
|
|
264
264
|
if (typeof validation === 'undefined') {
|
|
265
265
|
resolve();
|
|
266
266
|
} else {
|
|
267
|
-
console.log(this.getAll(), validation);
|
|
268
267
|
Logger.label('request-validation-failed');
|
|
269
268
|
const validationErrorResponse = new _response.default({}, 422);
|
|
270
269
|
Object.keys(validation).forEach(validationKey => {
|