From 92986b77e3d454a43e6d39a16fb52f465a6e8c4b Mon Sep 17 00:00:00 2001 From: Naz Date: Mon, 8 Nov 2021 16:09:19 +0400 Subject: [PATCH] Renamed whitelist -> allowlist no issue - Renames to follow the naming convention from https://mysqlhighavailability.com/mysql-terminology-updates/ --- core/server/web/api/middleware/cors.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/server/web/api/middleware/cors.js b/core/server/web/api/middleware/cors.js index 4f8da966c7..4716767723 100644 --- a/core/server/web/api/middleware/cors.js +++ b/core/server/web/api/middleware/cors.js @@ -3,7 +3,7 @@ const url = require('url'); const os = require('os'); const urlUtils = require('../../../../shared/url-utils'); -let whitelist = []; +let allowlist = []; const ENABLE_CORS = {origin: true, maxAge: 86400}; const DISABLE_CORS = {origin: false}; @@ -46,16 +46,16 @@ function getUrls() { return urls; } -function getWhitelist() { +function getAllowlist() { // This needs doing just one time after init - if (whitelist.length === 0) { + if (allowlist.length === 0) { // origins that always match: localhost, local IPs, etc. - whitelist = whitelist.concat(getIPs()); + allowlist = allowlist.concat(getIPs()); // Trusted urls from config.js - whitelist = whitelist.concat(getUrls()); + allowlist = allowlist.concat(getUrls()); } - return whitelist; + return allowlist; } /** @@ -73,7 +73,7 @@ function handleCORS(req, cb) { } // Origin matches whitelist - if (getWhitelist().indexOf(url.parse(origin).hostname) > -1) { + if (getAllowlist().indexOf(url.parse(origin).hostname) > -1) { return cb(null, ENABLE_CORS); }