diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx index 77f6109db52a9..55bceb7369570 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -853,8 +853,9 @@ const DatabaseModal: FunctionComponent = ({ const { hostname } = window.location; let ipAlert = connectionAlert?.REGIONAL_IPS?.default || ''; const regionalIPs = connectionAlert?.REGIONAL_IPS || {}; - Object.entries(regionalIPs).forEach(([regex, ipRange]) => { - if (regex.match(hostname)) { + Object.entries(regionalIPs).forEach(([ipRegion, ipRange]) => { + const regex = new RegExp(ipRegion); + if (hostname.match(regex)) { ipAlert = ipRange; } });