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()
f := ln.F{
"remote": req.RemoteAddr,
"host": req.Host,
"uri": req.RequestURI,
"req_remote": req.RemoteAddr,
"req_host": req.Host,
"req_uri": req.RequestURI,
"req_method": req.Method,
"req_content_length": req.ContentLength,
}
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{
"status": resp.Status,
"status_code": resp.StatusCode,
"content_length": resp.ContentLength,
"resp_status_code": resp.StatusCode,
"resp_content_length": resp.ContentLength,
})
return resp, nil