From a29a7d492304ddc6292f69a14f9e5c946e06f935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B2=B3?= Date: Mon, 4 Mar 2019 18:46:33 +0800 Subject: [PATCH] http bug --- server/proxy/http.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/proxy/http.go b/server/proxy/http.go index 2895a8e..bf7a0ad 100644 --- a/server/proxy/http.go +++ b/server/proxy/http.go @@ -128,11 +128,11 @@ func (s *httpServer) process(c *conn.Conn, r *http.Request) { logs.Notice("the url %s %s can't be parsed!", r.Host, r.RequestURI) goto end } else if !host.Client.GetConn() { //conn num limit - logs.Notice("Connections exceed the current client %d limit %d ,now connection num %d", host.Client.Id, host.Client.MaxConn, host.Client.NowConn) + logs.Notice("connections exceed the current client %d limit %d ,now connection num %d", host.Client.Id, host.Client.MaxConn, host.Client.NowConn) c.Close() return } else { - logs.Trace("New http(s) connection,clientId %d,host %s,url %s,remote address %s", host.Client.Id, r.Host, r.URL, r.RemoteAddr) + logs.Trace("new http(s) connection,clientId %d,host %s,url %s,remote address %s", host.Client.Id, r.Host, r.URL, r.RemoteAddr) lastHost = host } for { @@ -167,6 +167,14 @@ func (s *httpServer) process(c *conn.Conn, r *http.Request) { break } logs.Trace("New http(s) connection,clientId %d,host %s,url %s,remote address %s", host.Client.Id, r.Host, r.URL, r.RemoteAddr) + //What happened ,Why one character less??? + if r.Method == "ET" { + r.Method = "GET" + } + if r.Method == "OST" { + r.Method = "POST" + } + logs.Trace("new http(s) connection,clientId %d,host %s,url %s,remote address %s", host.Client.Id, r.Host, r.URL, r.RemoteAddr) if host, err = file.GetCsvDb().GetInfoByHost(r.Host, r); err != nil { logs.Notice("the url %s %s can't be parsed!", r.Host, r.RequestURI) break