From c5017bc57c80bf07a236244a101eae8669dc7529 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Thu, 11 Jun 2020 11:10:08 +0800 Subject: [PATCH] Fix: trim FQDN on http proxy request --- adapters/inbound/util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adapters/inbound/util.go b/adapters/inbound/util.go index 16b440e9..a9901d0a 100644 --- a/adapters/inbound/util.go +++ b/adapters/inbound/util.go @@ -4,6 +4,7 @@ import ( "net" "net/http" "strconv" + "strings" "github.com/Dreamacro/clash/component/socks5" C "github.com/Dreamacro/clash/constant" @@ -38,6 +39,9 @@ func parseHTTPAddr(request *http.Request) *C.Metadata { port = "80" } + // trim FQDN (#737) + host = strings.TrimRight(host, ".") + metadata := &C.Metadata{ NetWork: C.TCP, AddrType: C.AtypDomainName,