idea-aws 3.13.4 → 3.13.5
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.
|
@@ -119,7 +119,12 @@ class ResourceController extends genericController_1.GenericController {
|
|
|
119
119
|
this.pathParameters[param] = event.pathParameters[param] ? decodeURIComponent(event.pathParameters[param]) : null;
|
|
120
120
|
this.resourceId = this.pathParameters[options.resourceId || 'proxy'];
|
|
121
121
|
this.queryParams = event.queryStringParameters || {};
|
|
122
|
-
|
|
122
|
+
try {
|
|
123
|
+
this.body = (event.body ? JSON.parse(event.body) : {}) || {};
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
throw new RCError('Malformed body');
|
|
127
|
+
}
|
|
123
128
|
}
|
|
124
129
|
initFromEventV1(event, options) {
|
|
125
130
|
this.authorization = event.headers.Authorization;
|
|
@@ -135,7 +140,12 @@ class ResourceController extends genericController_1.GenericController {
|
|
|
135
140
|
this.pathParameters[param] = event.pathParameters[param] ? decodeURIComponent(event.pathParameters[param]) : null;
|
|
136
141
|
this.resourceId = this.pathParameters[options.resourceId || 'proxy'];
|
|
137
142
|
this.queryParams = event.queryStringParameters || {};
|
|
138
|
-
|
|
143
|
+
try {
|
|
144
|
+
this.body = (event.body ? JSON.parse(event.body) : {}) || {};
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
throw new RCError('Malformed body');
|
|
148
|
+
}
|
|
139
149
|
}
|
|
140
150
|
controlHandlerError(err = {}, context, replaceWithErrorMessage) {
|
|
141
151
|
if (err instanceof RCError)
|