internal/tun2: qualify key names in request/response proxying

This commit is contained in:
Cadey Ratio 2018-01-16 21:50:32 -08:00
parent 7c6cf0f7bd
commit ee6525661b
1 changed files with 7 additions and 6 deletions

View File

@ -412,9 +412,11 @@ func (s *Server) RoundTrip(req *http.Request) (*http.Response, error) {
ctx := req.Context() ctx := req.Context()
f := ln.F{ f := ln.F{
"remote": req.RemoteAddr, "req_remote": req.RemoteAddr,
"host": req.Host, "req_host": req.Host,
"uri": req.RequestURI, "req_uri": req.RequestURI,
"req_method": req.Method,
"req_content_length": req.ContentLength,
} }
val, ok := s.domains.Get(req.Host) val, ok := s.domains.Get(req.Host)
@ -451,9 +453,8 @@ func (s *Server) RoundTrip(req *http.Request) (*http.Response, error) {
} }
ln.Log(ctx, c, ln.Action("http traffic"), f, ln.F{ ln.Log(ctx, c, ln.Action("http traffic"), f, ln.F{
"status": resp.Status, "resp_status_code": resp.StatusCode,
"status_code": resp.StatusCode, "resp_content_length": resp.ContentLength,
"content_length": resp.ContentLength,
}) })
return resp, nil return resp, nil