diff options
Diffstat (limited to 'reqToPB.go')
| -rw-r--r-- | reqToPB.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -53,6 +53,13 @@ func ReqToPB(r *http.Request) (*HttpRequest, error) { } } + query := make(map[string]string) + for param, values := range r.URL.Query() { + if len(values) > 0 { + query[param] = strings.Join(values, "\n") + } + } + msg, err := ioutil.ReadAll(r.Body) // Read the body as []byte r.Body.Close() // log.Info("TRYING TO MARSHAL bytes:", len(msg), err) @@ -67,6 +74,9 @@ func ReqToPB(r *http.Request) (*HttpRequest, error) { ClientData: msg, ClientDataLen: int64(len(msg)), Hostname: r.Header.Get("hostname"), + UserAgent: r.UserAgent(), + Query: query, + RemoteAddr: r.RemoteAddr, } pb.Route = cleanURL(r.URL.Path) |
