badmfck-api-server 1.7.0 → 1.7.2
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.
|
@@ -128,7 +128,8 @@ class APIService extends BaseService_1.BaseService {
|
|
|
128
128
|
if (!i.endpoints)
|
|
129
129
|
continue;
|
|
130
130
|
for (let j of i.endpoints) {
|
|
131
|
-
|
|
131
|
+
let ep = BaseEndpoint_1.BaseEndpoint.getEntryPoint() + j.endpoint;
|
|
132
|
+
ep = ep.replaceAll("//", "/");
|
|
132
133
|
app.all(ep, async (req, res) => {
|
|
133
134
|
const tme = +new Date();
|
|
134
135
|
let log = null;
|
|
@@ -60,7 +60,9 @@ class BaseEndpoint {
|
|
|
60
60
|
async execute(req) {
|
|
61
61
|
if (this.endpoints && this.endpoints.length > 0) {
|
|
62
62
|
for (let i of this.endpoints) {
|
|
63
|
-
|
|
63
|
+
let targetEP = BaseEndpoint.entrypoint + i.endpoint;
|
|
64
|
+
targetEP = targetEP.replaceAll("//", "/");
|
|
65
|
+
if (targetEP === req.endpoint && i.handler && typeof i.handler === "function")
|
|
64
66
|
return i.handler.call(this, req);
|
|
65
67
|
}
|
|
66
68
|
}
|