From 4e5a34b772db9df404b0b927f3ee9b9b54f65cdd Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 6 Sep 2025 18:43:23 -0500 Subject: convert http req directly to PB --- handlePatches.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'handlePatches.go') diff --git a/handlePatches.go b/handlePatches.go index 3a0317c..f270d74 100644 --- a/handlePatches.go +++ b/handlePatches.go @@ -5,6 +5,7 @@ import ( "strings" "go.wit.com/lib/protobuf/forgepb" + "go.wit.com/lib/protobuf/httppb" "go.wit.com/log" ) @@ -33,6 +34,12 @@ func handlePatches(w http.ResponseWriter, r *http.Request, data []byte) error { return nil } +func makePatchesPB(reqPB *httppb.HttpRequest) (*forgepb.Patches, error) { + pb := forgepb.NewPatches() + err := pb.Unmarshal(reqPB.Body) + return pb, err +} + func sendPatchesError(w http.ResponseWriter, r *forgepb.Patches, err error) error { log.Info("send error back to user", err) return nil -- cgit v1.2.3