mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-11 22:30:47 +01:00
fix query being duplicated
This commit is contained in:
@@ -60,7 +60,7 @@ var (
|
||||
|
||||
var (
|
||||
HTTPProxyURL = types.MustParseURL(APIBaseURL + EndpointProxyHTTP)
|
||||
HTTPProxyURLStripLen = len(HTTPProxyURL.Path)
|
||||
HTTPProxyURLStripLen = len(APIEndpointBase + EndpointProxyHTTP)
|
||||
)
|
||||
|
||||
func IsDockerHostAgent(dockerHost string) bool {
|
||||
|
||||
@@ -3,6 +3,7 @@ package handler
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@@ -24,8 +25,6 @@ func ProxyHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
responseHeaderTimeout = 0
|
||||
}
|
||||
|
||||
logging.Debug().Msgf("proxy http request: host=%s, isHTTPs=%t, skipTLSVerify=%t, responseHeaderTimeout=%d", host, isHTTPS, skipTLSVerify, responseHeaderTimeout)
|
||||
|
||||
if host == "" {
|
||||
http.Error(w, "missing required headers", http.StatusBadRequest)
|
||||
return
|
||||
@@ -54,6 +53,9 @@ func ProxyHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
logging.Debug().Msgf("proxy http request: %s %s", r.Method, r.URL.String())
|
||||
|
||||
rp := reverseproxy.NewReverseProxy("agent", types.NewURL(r.URL), transport)
|
||||
rp := reverseproxy.NewReverseProxy("agent", types.NewURL(&url.URL{
|
||||
Scheme: scheme,
|
||||
Host: host,
|
||||
}), transport)
|
||||
rp.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user