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

(cherry picked from commit a6aad52)
  • Loading branch information
AAfghahi authored and henryyeh committed Aug 24, 2021
1 parent a300d51 commit c4315a2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,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 c4315a2

Please sign in to comment.