Skip to content

Commit 48a7db4

Browse files
[IIIF-188] remove useless check
1 parent 4880d8a commit 48a7db4

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

server.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export function app() {
244244
if(referer && !referer.startsWith('/')) {
245245
try {
246246
const origin = new URL(referer).origin;
247-
if (isIiifAllowedOrigin(origin)) {
247+
if (IIIF_ALLOWED_ORIGINS.includes(origin)) {
248248
console.info('Found allowed origin, setting headers for IIIF viewer');
249249
// CORS header
250250
res.setHeader('Access-Control-Allow-Origin', origin);
@@ -704,12 +704,6 @@ function healthCheck(req, res) {
704704
});
705705
}
706706

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

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

0 commit comments

Comments
 (0)