summaryrefslogtreecommitdiff
path: root/reqToPB.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-09 18:02:31 -0500
committerJeff Carr <[email protected]>2025-09-09 18:02:31 -0500
commit3306e3cbbc48eea6eb2666c8f3d5a2f250db46a3 (patch)
treed5579bb5269cf72f7733a608ec6f555180c20abd /reqToPB.go
parentcd656f489e14ae47f8c2fb4304a58a85037556a2 (diff)
add more missing fields to the .protov0.0.9v0.0.8
Diffstat (limited to 'reqToPB.go')
-rw-r--r--reqToPB.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/reqToPB.go b/reqToPB.go
index 019ad77..3d34caa 100644
--- a/reqToPB.go
+++ b/reqToPB.go
@@ -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)