Merge 4732479d324e7b29c3589a0e898e403cbc98bf33 into 01fed8d1a97dce7d19d520877949f6e19054ee54

This commit is contained in:
Bai Loong 2024-12-19 18:26:17 +08:00 committed by GitHub
commit ac37f3da7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,7 +66,8 @@ func NewHTTPReverseProxy(option HTTPReverseProxyOptions, vhostRouter *Routers) *
req.URL.Scheme = "http" req.URL.Scheme = "http"
reqRouteInfo := req.Context().Value(RouteInfoKey).(*RequestRouteInfo) reqRouteInfo := req.Context().Value(RouteInfoKey).(*RequestRouteInfo)
originalHost, _ := httppkg.CanonicalHost(reqRouteInfo.Host) originalHost, _ := httppkg.CanonicalHost(reqRouteInfo.Host)
//recover clean by proxy https://cs.opensource.google/go/go/+/refs/tags/go1.23.4:src/net/http/httputil/reverseproxy.go;l=427
req.URL.RawQuery = r.In.URL.RawQuery
rc := req.Context().Value(RouteConfigKey).(*RouteConfig) rc := req.Context().Value(RouteConfigKey).(*RouteConfig)
if rc != nil { if rc != nil {
if rc.RewriteHost != "" { if rc.RewriteHost != "" {