1
0
forked from apxtri/apxtri

clean cors

This commit is contained in:
philc 2024-02-27 12:37:56 +01:00
parent b838ab87f0
commit c66f856ccf

View File

@ -181,7 +181,6 @@ doms.forEach((d) => {
});
const regtxt = `^http.?:\/\/(${originlst})`;
let cor = false;
console.log(regtxt);
const regorigin = new RegExp(regtxt);
app.use((req, res, next) => {
if (req.headers.origin == undefined) {
@ -195,7 +194,7 @@ app.use((req, res, next) => {
"request origin:",
req.headers.origin,
"testcors:",
cor, "headers allowed: [", conf.api.exposedHeaders.join(','),"]"
cor, "headers allowed: [", conf.api.exposedHeaders.join(','),"] match with reg:", regtxt
);
cors({
origin: cor,