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})`;
|
const regtxt = `^http.?:\/\/(${originlst})`;
|
||||||
let cor = false;
|
let cor = false;
|
||||||
console.log(regtxt);
|
|
||||||
const regorigin = new RegExp(regtxt);
|
const regorigin = new RegExp(regtxt);
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
if (req.headers.origin == undefined) {
|
if (req.headers.origin == undefined) {
|
||||||
@ -195,7 +194,7 @@ app.use((req, res, next) => {
|
|||||||
"request origin:",
|
"request origin:",
|
||||||
req.headers.origin,
|
req.headers.origin,
|
||||||
"testcors:",
|
"testcors:",
|
||||||
cor, "headers allowed: [", conf.api.exposedHeaders.join(','),"]"
|
cor, "headers allowed: [", conf.api.exposedHeaders.join(','),"] match with reg:", regtxt
|
||||||
);
|
);
|
||||||
cors({
|
cors({
|
||||||
origin: cor,
|
origin: cor,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user