mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-08 09:07:44 +00:00
net/interfaces: ignore bogus proxy URLs from winhttp [windows]
Updates tailscale/corp#853
This commit is contained in:
parent
d21956436a
commit
d192bd0f86
@ -7,6 +7,7 @@
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
"net/url"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
@ -176,7 +177,12 @@ func getPACWindows() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
defer globalFree.Call(uintptr(unsafe.Pointer(res)))
|
defer globalFree.Call(uintptr(unsafe.Pointer(res)))
|
||||||
return windows.UTF16PtrToString(res)
|
s := windows.UTF16PtrToString(res)
|
||||||
|
if _, err := url.Parse(s); err != nil {
|
||||||
|
log.Printf("getPACWindows: invalid URL %q from winhttp; ignoring", s)
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return s
|
||||||
}
|
}
|
||||||
const (
|
const (
|
||||||
ERROR_WINHTTP_AUTODETECTION_FAILED = 12180
|
ERROR_WINHTTP_AUTODETECTION_FAILED = 12180
|
||||||
|
Loading…
x
Reference in New Issue
Block a user