@webtypen/webframez-core 0.0.45 → 0.0.47
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.d.ts
CHANGED
package/lib/Router/Router.js
CHANGED
|
@@ -226,7 +226,7 @@ class RouterFacade {
|
|
|
226
226
|
if (req && req.url && req.url.indexOf("?") > 0) {
|
|
227
227
|
const temp = req.url.substring(req.url.indexOf("?") + 1);
|
|
228
228
|
if (temp && temp.trim() !== "") {
|
|
229
|
-
const entries = temp.split("
|
|
229
|
+
const entries = temp.split("&");
|
|
230
230
|
for (let entry of entries) {
|
|
231
231
|
if (entry.indexOf("=") > 0) {
|
|
232
232
|
urlParams[entry.substring(0, entry.indexOf("="))] = entry.substring(entry.indexOf("=") + 1);
|
|
@@ -398,7 +398,7 @@ class RouterFacade {
|
|
|
398
398
|
if (this.mode === "aws-lambda") {
|
|
399
399
|
return {
|
|
400
400
|
statusCode: response.statusCode,
|
|
401
|
-
body: JSON.stringify(response.content),
|
|
401
|
+
body: typeof response.content === "object" ? JSON.stringify(response.content) : response.content,
|
|
402
402
|
headers: response.headers,
|
|
403
403
|
};
|
|
404
404
|
}
|
|
@@ -414,6 +414,7 @@ class RouterFacade {
|
|
|
414
414
|
body: JSON.stringify({
|
|
415
415
|
status: "error",
|
|
416
416
|
message: "Error running the component ...",
|
|
417
|
+
error: e.toString(),
|
|
417
418
|
}),
|
|
418
419
|
headers: response.headers,
|
|
419
420
|
};
|
package/package.json
CHANGED
package/src/Router/Router.ts
CHANGED
|
@@ -270,7 +270,7 @@ class RouterFacade {
|
|
|
270
270
|
if (req && req.url && req.url.indexOf("?") > 0) {
|
|
271
271
|
const temp = req.url.substring(req.url.indexOf("?") + 1);
|
|
272
272
|
if (temp && temp.trim() !== "") {
|
|
273
|
-
const entries = temp.split("
|
|
273
|
+
const entries = temp.split("&");
|
|
274
274
|
for (let entry of entries) {
|
|
275
275
|
if (entry.indexOf("=") > 0) {
|
|
276
276
|
urlParams[entry.substring(0, entry.indexOf("="))] = entry.substring(
|
|
@@ -472,20 +472,21 @@ class RouterFacade {
|
|
|
472
472
|
if (this.mode === "aws-lambda") {
|
|
473
473
|
return {
|
|
474
474
|
statusCode: response.statusCode,
|
|
475
|
-
body: JSON.stringify(response.content),
|
|
475
|
+
body: typeof response.content === "object" ? JSON.stringify(response.content) : response.content,
|
|
476
476
|
headers: response.headers,
|
|
477
477
|
};
|
|
478
478
|
} else if (res && req) {
|
|
479
479
|
res.end();
|
|
480
480
|
this.requestConsoleLog(req, response.statusCode);
|
|
481
481
|
}
|
|
482
|
-
} catch (e) {
|
|
482
|
+
} catch (e: any) {
|
|
483
483
|
if (this.mode === "aws-lambda") {
|
|
484
484
|
return {
|
|
485
485
|
statusCode: 500,
|
|
486
486
|
body: JSON.stringify({
|
|
487
487
|
status: "error",
|
|
488
488
|
message: "Error running the component ...",
|
|
489
|
+
error: e.toString(),
|
|
489
490
|
}),
|
|
490
491
|
headers: response.headers,
|
|
491
492
|
};
|