Skip to content

Commit 6f611d7

Browse files
[IIIF-188] remove useless check
1 parent 68082f4 commit 6f611d7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

server.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export function app() {
224224
if(referer && !referer.startsWith('/')) {
225225
try {
226226
const origin = new URL(referer).origin;
227-
if (isIiifAllowedOrigin(origin)) {
227+
if (IIIF_ALLOWED_ORIGINS.includes(origin)) {
228228
console.info('Found allowed origin, setting headers for IIIF viewer');
229229
// CORS header
230230
res.setHeader('Access-Control-Allow-Origin', origin);
@@ -705,12 +705,6 @@ function healthCheck(req, res) {
705705
});
706706
}
707707

708-
/*
709-
* Helper to determine if the origin is allowed
710-
*/
711-
function isIiifAllowedOrigin(origin) {
712-
return origin === REST_BASE_URL.replace("/server", "") || IIIF_ALLOWED_ORIGINS.includes(origin);
713-
}
714708

715709
// Webpack will replace 'require' with '__webpack_require__'
716710
// '__non_webpack_require__' is a proxy to Node 'require'

0 commit comments

Comments
 (0)