@webtypen/webframez-core 0.0.37 → 0.0.39
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/lib/Router/Router.js +4 -2
- package/package.json +1 -1
- package/src/Router/Router.ts +7 -2
package/lib/Router/Router.js
CHANGED
|
@@ -200,7 +200,7 @@ class RouterFacade {
|
|
|
200
200
|
let body = [];
|
|
201
201
|
const bodyPlain = this.mode === "aws-lambda"
|
|
202
202
|
? options && options.event && options.event.body
|
|
203
|
-
?
|
|
203
|
+
? options.event.body
|
|
204
204
|
: null
|
|
205
205
|
: req
|
|
206
206
|
? yield new Promise((resolve) => {
|
|
@@ -220,7 +220,9 @@ class RouterFacade {
|
|
|
220
220
|
(bodyPlain.trim().substring(0, 1) === "[" || bodyPlain.trim().substring(0, 1) === "{")
|
|
221
221
|
? JSON.parse(bodyPlain)
|
|
222
222
|
: bodyPlain
|
|
223
|
-
? qs_1.default.parse(
|
|
223
|
+
? qs_1.default.parse(options && options.event && options.event.isBase64Encoded
|
|
224
|
+
? Buffer.from(bodyPlain, "base64").toString("utf-8")
|
|
225
|
+
: bodyPlain)
|
|
224
226
|
: {},
|
|
225
227
|
bodyPlain: bodyPlain,
|
|
226
228
|
params: route && route.params ? route.params : {},
|
package/package.json
CHANGED
package/src/Router/Router.ts
CHANGED
|
@@ -233,7 +233,7 @@ class RouterFacade {
|
|
|
233
233
|
const bodyPlain: any =
|
|
234
234
|
this.mode === "aws-lambda"
|
|
235
235
|
? options && options.event && options.event.body
|
|
236
|
-
?
|
|
236
|
+
? options.event.body
|
|
237
237
|
: null
|
|
238
238
|
: req
|
|
239
239
|
? await new Promise((resolve: Function) => {
|
|
@@ -256,8 +256,13 @@ class RouterFacade {
|
|
|
256
256
|
(bodyPlain.trim().substring(0, 1) === "[" || bodyPlain.trim().substring(0, 1) === "{")
|
|
257
257
|
? JSON.parse(bodyPlain)
|
|
258
258
|
: bodyPlain
|
|
259
|
-
? qs.parse(
|
|
259
|
+
? qs.parse(
|
|
260
|
+
options && options.event && options.event.isBase64Encoded
|
|
261
|
+
? Buffer.from(bodyPlain, "base64").toString("utf-8")
|
|
262
|
+
: bodyPlain
|
|
263
|
+
)
|
|
260
264
|
: {},
|
|
265
|
+
|
|
261
266
|
bodyPlain: bodyPlain,
|
|
262
267
|
params: route && route.params ? route.params : {},
|
|
263
268
|
headers: customRequest.headers,
|