diff options
Diffstat (limited to 'pkg/server/hook/look-http.go')
| -rw-r--r-- | pkg/server/hook/look-http.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/pkg/server/hook/look-http.go b/pkg/server/hook/look-http.go index d467563..50ec663 100644 --- a/pkg/server/hook/look-http.go +++ b/pkg/server/hook/look-http.go @@ -2,7 +2,7 @@ package hook import ( "bufio" - "strings" + "tunnel/pkg/http" "tunnel/pkg/server/env" "tunnel/pkg/server/opts" "tunnel/pkg/server/queue" @@ -28,11 +28,8 @@ func (look *lookHttp) Send(rq, wq queue.Q) error { }() if s.Scan() { - if w := strings.Split(s.Text(), " "); len(w) > 1 { - switch m := strings.ToUpper(w[0]); m { - case "CONNECT", "GET", "POST": - look.env.Set("look.info", m+" "+w[1]) - } + if method, uri, _, ok := http.ParseRequestLine(s.Text()); ok { + look.env.Set("look.info", method+" "+uri) } } |
