Skip to content

Commit

Permalink
fix: regex for multi-region IPs (apache#16410)
Browse files Browse the repository at this point in the history
* regex for multi-region IPs

* Update index.tsx
  • Loading branch information
AAfghahi authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent 6ea88fb commit 62f0b57
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -853,8 +853,9 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
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;
}
});
Expand Down

0 comments on commit 62f0b57

Please sign in to comment.