forked from apxtri/apxtri
clean cors
This commit is contained in:
parent
b838ab87f0
commit
c66f856ccf
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user