mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2024-11-13 04:56:55 +03:00
Fix unit tests on Win10 (attempt 2)
Thanks to @lifenjoiner for testing! Windows 10 behaves even more unexpectedly. After it parses the "ip:port" string as a hostname, it attempts to upgrade from http to https by appending `:443` and parsing that new URL again. This seems to happen concurrently with the doomed DNS lookup and we see the error from whichever fails first.
This commit is contained in:
parent
8c42c465b2
commit
92dda0d55a
@ -308,8 +308,9 @@ func prepSourceTestDownload(t *testing.T, d *SourceTestData, e *SourceTestExpect
|
||||
case TestStateReadErr, TestStateReadSigErr:
|
||||
e.err = "unexpected EOF"
|
||||
case TestStateOpenErr, TestStateOpenSigErr:
|
||||
path = "00000" + path // high numeric port is parsed but then fails to connect
|
||||
e.err = "invalid port|no such host"
|
||||
path = "00000" + path // high numeric port should be parsed but then fail to connect
|
||||
// Win10 treats an invalid port as part of the hostname, then tries DNS lookup and magic http->https upgrades simultaneously
|
||||
e.err = "invalid port|no such host|too many colons in address"
|
||||
case TestStatePathErr:
|
||||
path = "..." + path // non-numeric port fails URL parsing
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user