use the common httppb

This commit is contained in:
Jeff Carr 2025-09-08 01:34:33 -05:00
parent a3007ba1b5
commit da9221ce34
1 changed files with 9 additions and 8 deletions

17
http.go
View File

@ -12,6 +12,7 @@ import (
"strings" "strings"
"go.wit.com/lib/protobuf/gitpb" "go.wit.com/lib/protobuf/gitpb"
"go.wit.com/lib/protobuf/httppb"
"go.wit.com/log" "go.wit.com/log"
) )
@ -117,14 +118,14 @@ func (pb *Patches) AddHttpToPB(r *http.Request) error {
} }
} }
pb.HttpRequest = &Patches_HttpRequest{ pb.HttpRequest = &httppb.HttpRequest{
Method: r.Method, Method: r.Method,
Url: r.URL.String(), URL: r.URL.String(),
Proto: r.Proto, Proto: r.Proto,
Headers: headers, Headers: headers,
RemoteAddr: getClientIP(r), IP: getClientIP(r),
Host: r.Host, Host: r.Host,
Hostname: r.Header.Get("hostname"), Hostname: r.Header.Get("hostname"),
} }
// pb.HttpRequest.Route = cleanURL(r.URL.Path) // pb.HttpRequest.Route = cleanURL(r.URL.Path)
return nil return nil