0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-16 05:17:16 +03:00

DNS New Features: disableCache, finalQuery, unexpectedIPs, "*", UseSystem-queryStrategy, useSystemHosts (#4666)

This commit is contained in:
patterniha
2025-06-06 05:29:16 +03:30
committed by GitHub
parent 028e1114e6
commit 6232e230d9
7 changed files with 444 additions and 189 deletions

View File

@ -539,7 +539,7 @@ func TestIPMatch(t *testing.T) {
},
Port: uint32(port),
},
Geoip: []*router.GeoIP{
ExpectedGeoip: []*router.GeoIP{
{
CountryCode: "local",
Cidr: []*router.CIDR{
@ -563,7 +563,7 @@ func TestIPMatch(t *testing.T) {
},
Port: uint32(port),
},
Geoip: []*router.GeoIP{
ExpectedGeoip: []*router.GeoIP{
{
CountryCode: "test",
Cidr: []*router.CIDR{
@ -667,7 +667,7 @@ func TestLocalDomain(t *testing.T) {
// Equivalent of dotless:localhost
{Type: DomainMatchingType_Regex, Domain: "^[^.]*localhost[^.]*$"},
},
Geoip: []*router.GeoIP{
ExpectedGeoip: []*router.GeoIP{
{ // Will match localhost, localhost-a and localhost-b,
CountryCode: "local",
Cidr: []*router.CIDR{
@ -897,7 +897,7 @@ func TestMultiMatchPrioritizedDomain(t *testing.T) {
Domain: "google.com",
},
},
Geoip: []*router.GeoIP{
ExpectedGeoip: []*router.GeoIP{
{ // Will only match 8.8.8.8 and 8.8.4.4
Cidr: []*router.CIDR{
{Ip: []byte{8, 8, 8, 8}, Prefix: 32},
@ -922,7 +922,7 @@ func TestMultiMatchPrioritizedDomain(t *testing.T) {
Domain: "google.com",
},
},
Geoip: []*router.GeoIP{
ExpectedGeoip: []*router.GeoIP{
{ // Will match 8.8.8.8 and 8.8.8.7, etc
Cidr: []*router.CIDR{
{Ip: []byte{8, 8, 8, 7}, Prefix: 24},
@ -946,7 +946,7 @@ func TestMultiMatchPrioritizedDomain(t *testing.T) {
Domain: "api.google.com",
},
},
Geoip: []*router.GeoIP{
ExpectedGeoip: []*router.GeoIP{
{ // Will only match 8.8.7.7 (api.google.com)
Cidr: []*router.CIDR{
{Ip: []byte{8, 8, 7, 7}, Prefix: 32},
@ -970,7 +970,7 @@ func TestMultiMatchPrioritizedDomain(t *testing.T) {
Domain: "v2.api.google.com",
},
},
Geoip: []*router.GeoIP{
ExpectedGeoip: []*router.GeoIP{
{ // Will only match 8.8.7.8 (v2.api.google.com)
Cidr: []*router.CIDR{
{Ip: []byte{8, 8, 7, 8}, Prefix: 32},