fix: format http log.
Some checks are pending
Coverage CI / build (push) Waiting to run
CodeQL / Analyze (go) (push) Waiting to run
Ubuntu CI / build (push) Waiting to run

This commit is contained in:
Daniel Ding
2025-04-14 15:10:44 +08:00
parent e1f19db6e4
commit 9665e5142a

View File

@@ -383,7 +383,7 @@ func (t *HttpProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
t.doRecord(r, 0)
via := t.FindBackend(r.URL.Host)
if via != nil {
t.out.Info("HttpProxy.ServeHTTP %s %s -> %s via %s", r.Method, r.RemoteAddr, r.URL.Host, via.Server)
t.out.Info("HttpProxy.ServeHTTP %s <- %s %s", via.Server, r.Method, r.URL.Host)
conn, err := t.openConn(via.Protocol, via.Server, via.Insecure)
if err != nil {
http.Error(w, err.Error(), http.StatusBadGateway)
@@ -407,7 +407,7 @@ func (t *HttpProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
t.out.Info("HttpProxy.ServeHTTP %s %s -> %s", r.Method, r.RemoteAddr, r.URL.Host)
t.out.Info("HttpProxy.ServeHTTP %s -> %s %s", r.RemoteAddr, r.Method, r.URL.Host)
if r.Method == "CONNECT" { //RFC-7231 Tunneling TCP based protocols through Web Proxy servers
conn, err := t.openConn("", r.URL.Host, true)
if err != nil {