mirror of
https://github.com/fosrl/newt.git
synced 2026-03-02 16:56:42 +00:00
Handle / better
This commit is contained in:
5
main.go
5
main.go
@@ -214,6 +214,9 @@ func resolveDomain(domain string) (string, error) {
|
|||||||
host = strings.TrimPrefix(host, "https://")
|
host = strings.TrimPrefix(host, "https://")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if there are any trailing slashes, remove them
|
||||||
|
host = strings.TrimSuffix(host, "/")
|
||||||
|
|
||||||
// Lookup IP addresses
|
// Lookup IP addresses
|
||||||
ips, err := net.LookupIP(host)
|
ips, err := net.LookupIP(host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -354,6 +357,8 @@ func main() {
|
|||||||
host = strings.TrimPrefix(host, "https://")
|
host = strings.TrimPrefix(host, "https://")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
host = strings.TrimSuffix(host, "/")
|
||||||
|
|
||||||
// Create WireGuard service
|
// Create WireGuard service
|
||||||
wgService, err = wg.NewWireGuardService(interfaceName, mtuInt, generateAndSaveKeyTo, host, id, client)
|
wgService, err = wg.NewWireGuardService(interfaceName, mtuInt, generateAndSaveKeyTo, host, id, client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user