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 committed Aug 23, 2021
1 parent 733bc32 commit 8668d2e
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 8668d2e

Please sign in to comment.