fix(other): allow Hong Kong login region
This commit is contained in:
parent
f79d460f10
commit
04097e530e
@ -32,10 +32,10 @@ public class IpCountryUtils {
|
|||||||
"香港", "澳门", "澳門", "台湾", "台灣", "Hong Kong", "Macau", "Macao", "Taiwan"
|
"香港", "澳门", "澳門", "台湾", "台灣", "Hong Kong", "Macau", "Macao", "Taiwan"
|
||||||
);
|
);
|
||||||
private static final List<String> BLOCKED_COUNTRY_CODES = List.of(
|
private static final List<String> BLOCKED_COUNTRY_CODES = List.of(
|
||||||
"HK", "MO", "SG", "TW"
|
"MO", "SG", "TW"
|
||||||
);
|
);
|
||||||
private static final List<String> BLOCKED_COUNTRY_NAMES = List.of(
|
private static final List<String> BLOCKED_COUNTRY_NAMES = List.of(
|
||||||
"香港", "澳门", "澳門", "台湾", "台灣", "Hong Kong", "Macau", "Macao", "Taiwan", "新加坡", "Singapore"
|
"澳门", "澳門", "台湾", "台灣", "Macau", "Macao", "Taiwan", "新加坡", "Singapore"
|
||||||
);
|
);
|
||||||
private static final List<IpGeoProvider> IP_GEO_PROVIDERS = List.of(
|
private static final List<IpGeoProvider> IP_GEO_PROVIDERS = List.of(
|
||||||
new IpGeoProvider("ip.sb", "https://api.ip.sb/geoip/%s"),
|
new IpGeoProvider("ip.sb", "https://api.ip.sb/geoip/%s"),
|
||||||
|
|||||||
@ -69,11 +69,19 @@ public class IpCountryUtilsTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void blockHongKongRegion() {
|
public void allowHongKongRegion() {
|
||||||
IpCountryUtils.IpGeoData data = new IpCountryUtils.IpGeoData("CN", "中国", "香港", "test");
|
IpCountryUtils.IpGeoData data = new IpCountryUtils.IpGeoData("CN", "中国", "香港", "test");
|
||||||
|
|
||||||
assertFalse(IpCountryUtils.isMainlandChina(data));
|
assertFalse(IpCountryUtils.isMainlandChina(data));
|
||||||
assertTrue(IpCountryUtils.isBlockedIpRegion(data));
|
assertFalse(IpCountryUtils.isBlockedIpRegion(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void allowHongKongCountryCode() {
|
||||||
|
IpCountryUtils.IpGeoData data = new IpCountryUtils.IpGeoData("HK", "Hong Kong", "", "test");
|
||||||
|
|
||||||
|
assertFalse(IpCountryUtils.isMainlandChina(data));
|
||||||
|
assertFalse(IpCountryUtils.isBlockedIpRegion(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user