itrm-tools 1.3.19-beta.3 → 1.3.19-beta.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.
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ExpressStandardConfiguration = void 0;
|
|
7
7
|
const express_1 = __importDefault(require("express"));
|
|
8
8
|
const cors_1 = __importDefault(require("cors"));
|
|
9
|
-
const APIService_1 = require("../APIService");
|
|
10
9
|
class ExpressStandardConfiguration {
|
|
11
10
|
apply(app) {
|
|
12
11
|
console.log("STANDARD CONFIG");
|
|
@@ -16,19 +15,21 @@ class ExpressStandardConfiguration {
|
|
|
16
15
|
//app.use(urlencoded({ extended: true }));
|
|
17
16
|
}
|
|
18
17
|
static getCorsConfiguration() {
|
|
18
|
+
console.log("CORS CONFIG");
|
|
19
19
|
return (0, cors_1.default)({
|
|
20
|
-
origin: function (origin, callback) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
20
|
+
// origin: function (origin: any, callback: any) {
|
|
21
|
+
// console.log("CORS ORIGIN CHECK");
|
|
22
|
+
// let whitelist = ITRMAPIServiceGlobal.whitelist;
|
|
23
|
+
// console.log({ whitelist });
|
|
24
|
+
// if (whitelist.length == 0 || (origin && whitelist.includes(origin))) {
|
|
25
|
+
// console.log('CORS request allowed:', { origin });
|
|
26
|
+
// callback(null, true);
|
|
27
|
+
// } else {
|
|
28
|
+
// console.log('CORS request denied:', { origin });
|
|
29
|
+
// callback(new Error('Not allowed by CORS'), false);
|
|
30
|
+
// }
|
|
31
|
+
// },
|
|
32
|
+
origin: 'http://localhost:5173',
|
|
32
33
|
credentials: true,
|
|
33
34
|
preflightContinue: false,
|
|
34
35
|
optionsSuccessStatus: 200,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressStandardConfiguration.js","sourceRoot":"","sources":["../../../src/api/express/ExpressStandardConfiguration.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA2C;AAC3C,gDAAwB;
|
|
1
|
+
{"version":3,"file":"ExpressStandardConfiguration.js","sourceRoot":"","sources":["../../../src/api/express/ExpressStandardConfiguration.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA2C;AAC3C,gDAAwB;AAKxB,MAAa,4BAA4B;IAC9B,KAAK,CAAC,GAAY;QACrB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAE/B,GAAG,CAAC,GAAG,CAAC,4BAA4B,CAAC,oBAAoB,EAAE,CAAC,CAAC;QAC7D,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACzC,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/D,0CAA0C;IAC9C,CAAC;IAEM,MAAM,CAAC,oBAAoB;QAC9B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC3B,OAAO,IAAA,cAAI,EAAC;YACR,kDAAkD;YAClD,wCAAwC;YACxC,sDAAsD;YACtD,kCAAkC;YAClC,6EAA6E;YAC7E,4DAA4D;YAC5D,gCAAgC;YAChC,eAAe;YACf,2DAA2D;YAC3D,6DAA6D;YAC7D,QAAQ;YACR,KAAK;YACL,MAAM,EAAE,uBAAuB;YAC/B,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,KAAK;YACxB,oBAAoB,EAAE,GAAG;YACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC;YACpD,cAAc,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,CAAC;SACjF,CAAC,CAAC;IACP,CAAC;CACJ;AAjCD,oEAiCC"}
|