summaryrefslogtreecommitdiff
path: root/reqToPB.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-07 20:34:56 -0500
committerJeff Carr <[email protected]>2025-09-07 21:41:28 -0500
commitaef7b966ffc2ed4245713ec4d705eab22ecc9644 (patch)
tree4bf1a9fabdb76f74c4fa6a264054f2f05ae9f810 /reqToPB.go
parent4b78407d3f06b82e7a6f34911fa5b45b833cfeea (diff)
change the names from the http standardsv0.0.4
I'll probably regret this and if anyone ever sees this and they actually use it, some people will probably complain. so: sorry It's not like HTTP isn't really well documented these days :) anyway, the *Addr fields are, I think, really really old kinda dumb names that were made to be super unique and ackward like RemoteAddr or whatever. Back then, having 'IP' would have been a major problem and PITA and super confusing. So I think everyone (I want to say 'we' but I don't know if I had anything to do with RemoteAddr. I think I did add the Apache guys to add SERVER_NAME support. Before that I don't think apache could respond to mosaic as 2 different hostnames. My memory could be incorrect.) named some of these things in ways that don't make sense in a protobuf like this where it should simply be IP
Diffstat (limited to 'reqToPB.go')
-rw-r--r--reqToPB.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/reqToPB.go b/reqToPB.go
index 747f1d4..f5aa766 100644
--- a/reqToPB.go
+++ b/reqToPB.go
@@ -58,14 +58,14 @@ func ReqToPB(r *http.Request) (*HttpRequest, error) {
// log.Info("TRYING TO MARSHAL bytes:", len(msg), err)
pb := &HttpRequest{
- Method: r.Method,
- Url: r.URL.String(),
- Proto: r.Proto,
- Headers: headers,
- RemoteAddr: getClientIP(r),
- Host: r.Host,
- Body: msg,
- Hostname: r.Header.Get("hostname"),
+ Method: r.Method,
+ URL: r.URL.String(),
+ Proto: r.Proto,
+ Headers: headers,
+ IP: getClientIP(r),
+ Host: r.Host,
+ Body: msg,
+ Hostname: r.Header.Get("hostname"),
}
pb.Route = cleanURL(r.URL.Path)