diff options
| author | Jeff Carr <[email protected]> | 2025-09-09 18:02:31 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-09 18:02:31 -0500 |
| commit | 3306e3cbbc48eea6eb2666c8f3d5a2f250db46a3 (patch) | |
| tree | d5579bb5269cf72f7733a608ec6f555180c20abd /reqToPB.go | |
| parent | cd656f489e14ae47f8c2fb4304a58a85037556a2 (diff) | |
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) |
