paygate-mcp 8.85.0 → 8.86.0
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/server.d.ts.map +1 -1
- package/dist/server.js +69 -55
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAgB,eAAe,EAA0B,MAAM,MAAM,CAAC;AAI7E,OAAO,EAAE,aAAa,EAAkB,mBAAmB,EAAkB,MAAM,SAAS,CAAC;AAE7F,OAAO,EAAE,MAAM,EAAiC,MAAM,UAAU,CAAC;AASjE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,cAAc,EAAqD,MAAM,WAAW,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAmB,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAS,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,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9B,OAAO,CAAC,sBAAsB;IA0E9B,qDAAqD;IACrD,OAAO,CAAC,UAAU;CAMnB"}
|
package/dist/server.js
CHANGED
|
@@ -94,6 +94,20 @@ const expiry_scanner_1 = require("./expiry-scanner");
|
|
|
94
94
|
const key_templates_1 = require("./key-templates");
|
|
95
95
|
/** Max request body size: 1MB */
|
|
96
96
|
const MAX_BODY_SIZE = 1_048_576;
|
|
97
|
+
/** Dangerous property names that enable prototype pollution attacks. */
|
|
98
|
+
const PROTO_POISON_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
|
|
99
|
+
/**
|
|
100
|
+
* JSON.parse with prototype pollution protection.
|
|
101
|
+
* Strips __proto__, constructor, and prototype keys from parsed objects
|
|
102
|
+
* to prevent Object.prototype pollution attacks via malicious payloads.
|
|
103
|
+
*/
|
|
104
|
+
function safeJsonParse(text) {
|
|
105
|
+
return JSON.parse(text, (key, value) => {
|
|
106
|
+
if (PROTO_POISON_KEYS.has(key))
|
|
107
|
+
return undefined; // Strip dangerous keys
|
|
108
|
+
return value;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
97
111
|
/** Max length for user-supplied string fields (names, reasons, messages, memos) */
|
|
98
112
|
const MAX_STRING_FIELD = 500;
|
|
99
113
|
/** Truncate user-supplied strings to MAX_STRING_FIELD to prevent log injection and memory abuse. */
|
|
@@ -1310,7 +1324,7 @@ class PayGateServer {
|
|
|
1310
1324
|
const body = await this.readBody(req);
|
|
1311
1325
|
let request;
|
|
1312
1326
|
try {
|
|
1313
|
-
request =
|
|
1327
|
+
request = safeJsonParse(body);
|
|
1314
1328
|
}
|
|
1315
1329
|
catch {
|
|
1316
1330
|
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
@@ -2049,7 +2063,7 @@ class PayGateServer {
|
|
|
2049
2063
|
const body = await this.readBody(req);
|
|
2050
2064
|
let params;
|
|
2051
2065
|
try {
|
|
2052
|
-
params =
|
|
2066
|
+
params = safeJsonParse(body);
|
|
2053
2067
|
}
|
|
2054
2068
|
catch {
|
|
2055
2069
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2212,7 +2226,7 @@ class PayGateServer {
|
|
|
2212
2226
|
const body = await this.readBody(req);
|
|
2213
2227
|
let params;
|
|
2214
2228
|
try {
|
|
2215
|
-
params =
|
|
2229
|
+
params = safeJsonParse(body);
|
|
2216
2230
|
}
|
|
2217
2231
|
catch {
|
|
2218
2232
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2268,7 +2282,7 @@ class PayGateServer {
|
|
|
2268
2282
|
const body = await this.readBody(req);
|
|
2269
2283
|
let params;
|
|
2270
2284
|
try {
|
|
2271
|
-
params =
|
|
2285
|
+
params = safeJsonParse(body);
|
|
2272
2286
|
}
|
|
2273
2287
|
catch {
|
|
2274
2288
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2365,7 +2379,7 @@ class PayGateServer {
|
|
|
2365
2379
|
const body = await this.readBody(req);
|
|
2366
2380
|
let params;
|
|
2367
2381
|
try {
|
|
2368
|
-
params =
|
|
2382
|
+
params = safeJsonParse(body);
|
|
2369
2383
|
}
|
|
2370
2384
|
catch {
|
|
2371
2385
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2542,7 +2556,7 @@ class PayGateServer {
|
|
|
2542
2556
|
const body = await this.readBody(req);
|
|
2543
2557
|
let params;
|
|
2544
2558
|
try {
|
|
2545
|
-
params =
|
|
2559
|
+
params = safeJsonParse(body);
|
|
2546
2560
|
}
|
|
2547
2561
|
catch {
|
|
2548
2562
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2599,7 +2613,7 @@ class PayGateServer {
|
|
|
2599
2613
|
const body = await this.readBody(req);
|
|
2600
2614
|
let params;
|
|
2601
2615
|
try {
|
|
2602
|
-
params =
|
|
2616
|
+
params = safeJsonParse(body);
|
|
2603
2617
|
}
|
|
2604
2618
|
catch {
|
|
2605
2619
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2643,7 +2657,7 @@ class PayGateServer {
|
|
|
2643
2657
|
const body = await this.readBody(req);
|
|
2644
2658
|
let params;
|
|
2645
2659
|
try {
|
|
2646
|
-
params =
|
|
2660
|
+
params = safeJsonParse(body);
|
|
2647
2661
|
}
|
|
2648
2662
|
catch {
|
|
2649
2663
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2694,7 +2708,7 @@ class PayGateServer {
|
|
|
2694
2708
|
const body = await this.readBody(req);
|
|
2695
2709
|
let params;
|
|
2696
2710
|
try {
|
|
2697
|
-
params =
|
|
2711
|
+
params = safeJsonParse(body);
|
|
2698
2712
|
}
|
|
2699
2713
|
catch {
|
|
2700
2714
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2742,7 +2756,7 @@ class PayGateServer {
|
|
|
2742
2756
|
const body = await this.readBody(req);
|
|
2743
2757
|
let params;
|
|
2744
2758
|
try {
|
|
2745
|
-
params =
|
|
2759
|
+
params = safeJsonParse(body);
|
|
2746
2760
|
}
|
|
2747
2761
|
catch {
|
|
2748
2762
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2813,7 +2827,7 @@ class PayGateServer {
|
|
|
2813
2827
|
if (!this.checkAdmin(req, res))
|
|
2814
2828
|
return;
|
|
2815
2829
|
const raw = await this.readBody(req);
|
|
2816
|
-
const params =
|
|
2830
|
+
const params = safeJsonParse(raw);
|
|
2817
2831
|
if (!params.key) {
|
|
2818
2832
|
this.sendError(res, 400, 'Missing "key" parameter');
|
|
2819
2833
|
return;
|
|
@@ -2868,7 +2882,7 @@ class PayGateServer {
|
|
|
2868
2882
|
const body = await this.readBody(req);
|
|
2869
2883
|
let params;
|
|
2870
2884
|
try {
|
|
2871
|
-
params =
|
|
2885
|
+
params = safeJsonParse(body);
|
|
2872
2886
|
}
|
|
2873
2887
|
catch {
|
|
2874
2888
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2915,7 +2929,7 @@ class PayGateServer {
|
|
|
2915
2929
|
const body = await this.readBody(req);
|
|
2916
2930
|
let params;
|
|
2917
2931
|
try {
|
|
2918
|
-
params =
|
|
2932
|
+
params = safeJsonParse(body);
|
|
2919
2933
|
}
|
|
2920
2934
|
catch {
|
|
2921
2935
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -2954,7 +2968,7 @@ class PayGateServer {
|
|
|
2954
2968
|
const body = await this.readBody(req);
|
|
2955
2969
|
let params;
|
|
2956
2970
|
try {
|
|
2957
|
-
params =
|
|
2971
|
+
params = safeJsonParse(body);
|
|
2958
2972
|
}
|
|
2959
2973
|
catch {
|
|
2960
2974
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -3010,7 +3024,7 @@ class PayGateServer {
|
|
|
3010
3024
|
const body = await this.readBody(req);
|
|
3011
3025
|
let params;
|
|
3012
3026
|
try {
|
|
3013
|
-
params =
|
|
3027
|
+
params = safeJsonParse(body);
|
|
3014
3028
|
}
|
|
3015
3029
|
catch {
|
|
3016
3030
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -3059,7 +3073,7 @@ class PayGateServer {
|
|
|
3059
3073
|
const body = await this.readBody(req);
|
|
3060
3074
|
let params;
|
|
3061
3075
|
try {
|
|
3062
|
-
params =
|
|
3076
|
+
params = safeJsonParse(body);
|
|
3063
3077
|
}
|
|
3064
3078
|
catch {
|
|
3065
3079
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -3100,7 +3114,7 @@ class PayGateServer {
|
|
|
3100
3114
|
const body = await this.readBody(req);
|
|
3101
3115
|
let params;
|
|
3102
3116
|
try {
|
|
3103
|
-
params =
|
|
3117
|
+
params = safeJsonParse(body);
|
|
3104
3118
|
}
|
|
3105
3119
|
catch {
|
|
3106
3120
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -3141,7 +3155,7 @@ class PayGateServer {
|
|
|
3141
3155
|
const body = await this.readBody(req);
|
|
3142
3156
|
let params;
|
|
3143
3157
|
try {
|
|
3144
|
-
params =
|
|
3158
|
+
params = safeJsonParse(body);
|
|
3145
3159
|
}
|
|
3146
3160
|
catch {
|
|
3147
3161
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -3898,7 +3912,7 @@ class PayGateServer {
|
|
|
3898
3912
|
const body = await this.readBody(req);
|
|
3899
3913
|
let params;
|
|
3900
3914
|
try {
|
|
3901
|
-
params =
|
|
3915
|
+
params = safeJsonParse(body);
|
|
3902
3916
|
}
|
|
3903
3917
|
catch {
|
|
3904
3918
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -4007,7 +4021,7 @@ class PayGateServer {
|
|
|
4007
4021
|
const body = await this.readBody(req);
|
|
4008
4022
|
let params;
|
|
4009
4023
|
try {
|
|
4010
|
-
params =
|
|
4024
|
+
params = safeJsonParse(body);
|
|
4011
4025
|
}
|
|
4012
4026
|
catch {
|
|
4013
4027
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -4137,7 +4151,7 @@ class PayGateServer {
|
|
|
4137
4151
|
const body = await this.readBody(req);
|
|
4138
4152
|
let params;
|
|
4139
4153
|
try {
|
|
4140
|
-
params =
|
|
4154
|
+
params = safeJsonParse(body);
|
|
4141
4155
|
}
|
|
4142
4156
|
catch {
|
|
4143
4157
|
this.sendError(res, 400, 'invalid_client_metadata');
|
|
@@ -4189,7 +4203,7 @@ class PayGateServer {
|
|
|
4189
4203
|
else if (req.method === 'POST') {
|
|
4190
4204
|
const body = await this.readBody(req);
|
|
4191
4205
|
try {
|
|
4192
|
-
params =
|
|
4206
|
+
params = safeJsonParse(body);
|
|
4193
4207
|
}
|
|
4194
4208
|
catch {
|
|
4195
4209
|
// Try URL-encoded form data
|
|
@@ -4270,7 +4284,7 @@ class PayGateServer {
|
|
|
4270
4284
|
const body = await this.readBody(req);
|
|
4271
4285
|
let params;
|
|
4272
4286
|
try {
|
|
4273
|
-
params =
|
|
4287
|
+
params = safeJsonParse(body);
|
|
4274
4288
|
}
|
|
4275
4289
|
catch {
|
|
4276
4290
|
// Try URL-encoded form data
|
|
@@ -4345,7 +4359,7 @@ class PayGateServer {
|
|
|
4345
4359
|
const body = await this.readBody(req);
|
|
4346
4360
|
let params;
|
|
4347
4361
|
try {
|
|
4348
|
-
params =
|
|
4362
|
+
params = safeJsonParse(body);
|
|
4349
4363
|
}
|
|
4350
4364
|
catch {
|
|
4351
4365
|
const query = new URLSearchParams(body);
|
|
@@ -4428,7 +4442,7 @@ class PayGateServer {
|
|
|
4428
4442
|
const body = await this.readBody(req);
|
|
4429
4443
|
let params;
|
|
4430
4444
|
try {
|
|
4431
|
-
params =
|
|
4445
|
+
params = safeJsonParse(body);
|
|
4432
4446
|
}
|
|
4433
4447
|
catch {
|
|
4434
4448
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -4507,7 +4521,7 @@ class PayGateServer {
|
|
|
4507
4521
|
let params = {};
|
|
4508
4522
|
if (body.trim()) {
|
|
4509
4523
|
try {
|
|
4510
|
-
params =
|
|
4524
|
+
params = safeJsonParse(body);
|
|
4511
4525
|
}
|
|
4512
4526
|
catch {
|
|
4513
4527
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -4562,7 +4576,7 @@ class PayGateServer {
|
|
|
4562
4576
|
}
|
|
4563
4577
|
let params;
|
|
4564
4578
|
try {
|
|
4565
|
-
params =
|
|
4579
|
+
params = safeJsonParse(body);
|
|
4566
4580
|
}
|
|
4567
4581
|
catch {
|
|
4568
4582
|
this.sendError(res, 400, 'Invalid JSON body');
|
|
@@ -8995,7 +9009,7 @@ class PayGateServer {
|
|
|
8995
9009
|
}
|
|
8996
9010
|
let params;
|
|
8997
9011
|
try {
|
|
8998
|
-
params =
|
|
9012
|
+
params = safeJsonParse(body);
|
|
8999
9013
|
}
|
|
9000
9014
|
catch {
|
|
9001
9015
|
this.sendError(res, 400, 'Invalid JSON body');
|
|
@@ -9112,7 +9126,7 @@ class PayGateServer {
|
|
|
9112
9126
|
}
|
|
9113
9127
|
let params;
|
|
9114
9128
|
try {
|
|
9115
|
-
params =
|
|
9129
|
+
params = safeJsonParse(body);
|
|
9116
9130
|
}
|
|
9117
9131
|
catch {
|
|
9118
9132
|
this.sendError(res, 400, 'Invalid JSON body');
|
|
@@ -9370,7 +9384,7 @@ class PayGateServer {
|
|
|
9370
9384
|
}
|
|
9371
9385
|
let params;
|
|
9372
9386
|
try {
|
|
9373
|
-
params =
|
|
9387
|
+
params = safeJsonParse(body);
|
|
9374
9388
|
}
|
|
9375
9389
|
catch {
|
|
9376
9390
|
this.sendError(res, 400, 'Invalid JSON body');
|
|
@@ -9452,7 +9466,7 @@ class PayGateServer {
|
|
|
9452
9466
|
}
|
|
9453
9467
|
let params;
|
|
9454
9468
|
try {
|
|
9455
|
-
params =
|
|
9469
|
+
params = safeJsonParse(body);
|
|
9456
9470
|
}
|
|
9457
9471
|
catch {
|
|
9458
9472
|
this.sendError(res, 400, 'Invalid JSON body');
|
|
@@ -9511,7 +9525,7 @@ class PayGateServer {
|
|
|
9511
9525
|
}
|
|
9512
9526
|
let params;
|
|
9513
9527
|
try {
|
|
9514
|
-
params =
|
|
9528
|
+
params = safeJsonParse(body);
|
|
9515
9529
|
}
|
|
9516
9530
|
catch {
|
|
9517
9531
|
this.sendError(res, 400, 'Invalid JSON body');
|
|
@@ -9571,7 +9585,7 @@ class PayGateServer {
|
|
|
9571
9585
|
try {
|
|
9572
9586
|
const raw = await this.readBody(req);
|
|
9573
9587
|
if (raw.trim()) {
|
|
9574
|
-
body =
|
|
9588
|
+
body = safeJsonParse(raw);
|
|
9575
9589
|
}
|
|
9576
9590
|
}
|
|
9577
9591
|
catch {
|
|
@@ -9806,7 +9820,7 @@ class PayGateServer {
|
|
|
9806
9820
|
try {
|
|
9807
9821
|
const raw = await this.readBody(req);
|
|
9808
9822
|
if (raw) {
|
|
9809
|
-
const body =
|
|
9823
|
+
const body = safeJsonParse(raw);
|
|
9810
9824
|
if (body && typeof body === 'object' && body.message) {
|
|
9811
9825
|
customMessage = String(body.message);
|
|
9812
9826
|
}
|
|
@@ -9917,7 +9931,7 @@ class PayGateServer {
|
|
|
9917
9931
|
const body = await this.readBody(req);
|
|
9918
9932
|
let params;
|
|
9919
9933
|
try {
|
|
9920
|
-
params =
|
|
9934
|
+
params = safeJsonParse(body);
|
|
9921
9935
|
}
|
|
9922
9936
|
catch {
|
|
9923
9937
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -9954,7 +9968,7 @@ class PayGateServer {
|
|
|
9954
9968
|
const body = await this.readBody(req);
|
|
9955
9969
|
let params;
|
|
9956
9970
|
try {
|
|
9957
|
-
params =
|
|
9971
|
+
params = safeJsonParse(body);
|
|
9958
9972
|
}
|
|
9959
9973
|
catch {
|
|
9960
9974
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -9995,7 +10009,7 @@ class PayGateServer {
|
|
|
9995
10009
|
const body = await this.readBody(req);
|
|
9996
10010
|
let params;
|
|
9997
10011
|
try {
|
|
9998
|
-
params =
|
|
10012
|
+
params = safeJsonParse(body);
|
|
9999
10013
|
}
|
|
10000
10014
|
catch {
|
|
10001
10015
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10133,7 +10147,7 @@ class PayGateServer {
|
|
|
10133
10147
|
const body = await this.readBody(req);
|
|
10134
10148
|
let params;
|
|
10135
10149
|
try {
|
|
10136
|
-
params =
|
|
10150
|
+
params = safeJsonParse(body);
|
|
10137
10151
|
}
|
|
10138
10152
|
catch {
|
|
10139
10153
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10168,7 +10182,7 @@ class PayGateServer {
|
|
|
10168
10182
|
const body = await this.readBody(req);
|
|
10169
10183
|
let params;
|
|
10170
10184
|
try {
|
|
10171
|
-
params =
|
|
10185
|
+
params = safeJsonParse(body);
|
|
10172
10186
|
}
|
|
10173
10187
|
catch {
|
|
10174
10188
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10203,7 +10217,7 @@ class PayGateServer {
|
|
|
10203
10217
|
const body = await this.readBody(req);
|
|
10204
10218
|
let params;
|
|
10205
10219
|
try {
|
|
10206
|
-
params =
|
|
10220
|
+
params = safeJsonParse(body);
|
|
10207
10221
|
}
|
|
10208
10222
|
catch {
|
|
10209
10223
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10232,7 +10246,7 @@ class PayGateServer {
|
|
|
10232
10246
|
const body = await this.readBody(req);
|
|
10233
10247
|
let params;
|
|
10234
10248
|
try {
|
|
10235
|
-
params =
|
|
10249
|
+
params = safeJsonParse(body);
|
|
10236
10250
|
}
|
|
10237
10251
|
catch {
|
|
10238
10252
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10274,7 +10288,7 @@ class PayGateServer {
|
|
|
10274
10288
|
const body = await this.readBody(req);
|
|
10275
10289
|
let params;
|
|
10276
10290
|
try {
|
|
10277
|
-
params =
|
|
10291
|
+
params = safeJsonParse(body);
|
|
10278
10292
|
}
|
|
10279
10293
|
catch {
|
|
10280
10294
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10340,7 +10354,7 @@ class PayGateServer {
|
|
|
10340
10354
|
const body = await this.readBody(req);
|
|
10341
10355
|
let params;
|
|
10342
10356
|
try {
|
|
10343
|
-
params =
|
|
10357
|
+
params = safeJsonParse(body);
|
|
10344
10358
|
}
|
|
10345
10359
|
catch {
|
|
10346
10360
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10390,7 +10404,7 @@ class PayGateServer {
|
|
|
10390
10404
|
const body = await this.readBody(req);
|
|
10391
10405
|
let params;
|
|
10392
10406
|
try {
|
|
10393
|
-
params =
|
|
10407
|
+
params = safeJsonParse(body);
|
|
10394
10408
|
}
|
|
10395
10409
|
catch {
|
|
10396
10410
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10475,7 +10489,7 @@ class PayGateServer {
|
|
|
10475
10489
|
const body = await this.readBody(req);
|
|
10476
10490
|
let params;
|
|
10477
10491
|
try {
|
|
10478
|
-
params =
|
|
10492
|
+
params = safeJsonParse(body);
|
|
10479
10493
|
}
|
|
10480
10494
|
catch {
|
|
10481
10495
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10520,7 +10534,7 @@ class PayGateServer {
|
|
|
10520
10534
|
const body = await this.readBody(req);
|
|
10521
10535
|
let params;
|
|
10522
10536
|
try {
|
|
10523
|
-
params =
|
|
10537
|
+
params = safeJsonParse(body);
|
|
10524
10538
|
}
|
|
10525
10539
|
catch {
|
|
10526
10540
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10570,7 +10584,7 @@ class PayGateServer {
|
|
|
10570
10584
|
const body = await this.readBody(req);
|
|
10571
10585
|
let params;
|
|
10572
10586
|
try {
|
|
10573
|
-
params =
|
|
10587
|
+
params = safeJsonParse(body);
|
|
10574
10588
|
}
|
|
10575
10589
|
catch {
|
|
10576
10590
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10604,7 +10618,7 @@ class PayGateServer {
|
|
|
10604
10618
|
const body = await this.readBody(req);
|
|
10605
10619
|
let params;
|
|
10606
10620
|
try {
|
|
10607
|
-
params =
|
|
10621
|
+
params = safeJsonParse(body);
|
|
10608
10622
|
}
|
|
10609
10623
|
catch {
|
|
10610
10624
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10650,7 +10664,7 @@ class PayGateServer {
|
|
|
10650
10664
|
const body = await this.readBody(req);
|
|
10651
10665
|
let params;
|
|
10652
10666
|
try {
|
|
10653
|
-
params =
|
|
10667
|
+
params = safeJsonParse(body);
|
|
10654
10668
|
}
|
|
10655
10669
|
catch {
|
|
10656
10670
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10708,7 +10722,7 @@ class PayGateServer {
|
|
|
10708
10722
|
const body = await this.readBody(req);
|
|
10709
10723
|
let params;
|
|
10710
10724
|
try {
|
|
10711
|
-
params =
|
|
10725
|
+
params = safeJsonParse(body);
|
|
10712
10726
|
}
|
|
10713
10727
|
catch {
|
|
10714
10728
|
this.sendError(res, 400, 'Invalid JSON body');
|
|
@@ -10754,7 +10768,7 @@ class PayGateServer {
|
|
|
10754
10768
|
const body = await this.readBody(req);
|
|
10755
10769
|
let params;
|
|
10756
10770
|
try {
|
|
10757
|
-
params =
|
|
10771
|
+
params = safeJsonParse(body);
|
|
10758
10772
|
}
|
|
10759
10773
|
catch {
|
|
10760
10774
|
this.sendError(res, 400, 'Invalid JSON body');
|
|
@@ -10827,7 +10841,7 @@ class PayGateServer {
|
|
|
10827
10841
|
const body = await this.readBody(req);
|
|
10828
10842
|
let params;
|
|
10829
10843
|
try {
|
|
10830
|
-
params =
|
|
10844
|
+
params = safeJsonParse(body);
|
|
10831
10845
|
}
|
|
10832
10846
|
catch {
|
|
10833
10847
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -10862,7 +10876,7 @@ class PayGateServer {
|
|
|
10862
10876
|
const body = await this.readBody(req);
|
|
10863
10877
|
let params;
|
|
10864
10878
|
try {
|
|
10865
|
-
params =
|
|
10879
|
+
params = safeJsonParse(body);
|
|
10866
10880
|
}
|
|
10867
10881
|
catch {
|
|
10868
10882
|
this.sendError(res, 400, 'Invalid JSON');
|
|
@@ -11244,7 +11258,7 @@ class PayGateServer {
|
|
|
11244
11258
|
try {
|
|
11245
11259
|
const raw = await this.readBody(req);
|
|
11246
11260
|
try {
|
|
11247
|
-
const params =
|
|
11261
|
+
const params = safeJsonParse(raw);
|
|
11248
11262
|
const apiKey = params.key;
|
|
11249
11263
|
const toolName = params.tool;
|
|
11250
11264
|
if (!apiKey || typeof apiKey !== 'string') {
|
|
@@ -11367,7 +11381,7 @@ class PayGateServer {
|
|
|
11367
11381
|
try {
|
|
11368
11382
|
const raw = await this.readBody(req);
|
|
11369
11383
|
try {
|
|
11370
|
-
const params =
|
|
11384
|
+
const params = safeJsonParse(raw);
|
|
11371
11385
|
const apiKey = params.key;
|
|
11372
11386
|
const tools = params.tools;
|
|
11373
11387
|
if (!apiKey || typeof apiKey !== 'string') {
|