update allowlist
This commit is contained in:
parent
c828815e8f
commit
36cc7470be
1 changed files with 2 additions and 2 deletions
4
index.js
4
index.js
|
@ -62,11 +62,11 @@ const getFileType = (filename) => {
|
||||||
return type;
|
return type;
|
||||||
};
|
};
|
||||||
|
|
||||||
const allowlist = ['https://files.hippoz.xyz', 'https://hippoz.xyz']
|
const allowlist = ['https://files.hippoz.xyz/', 'https://hippoz.xyz/', 'https://files.hippoz.xyz', 'https://hippoz.xyz']
|
||||||
const corsOptions = {
|
const corsOptions = {
|
||||||
origin: function (origin, callback) {
|
origin: function (origin, callback) {
|
||||||
if (allowlist.indexOf(origin) !== -1) {
|
if (allowlist.indexOf(origin) !== -1) {
|
||||||
callback(null, true)
|
callback(null, true)
|
||||||
} else {
|
} else {
|
||||||
callback(new Error('Not allowed by CORS'))
|
callback(new Error('Not allowed by CORS'))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue