From 91815788c989cd9cff4ec7846c87068b359eec34 Mon Sep 17 00:00:00 2001 From: Maria Ines Parnisari Date: Mon, 19 Feb 2024 21:24:55 -0300 Subject: [PATCH] fix version of gateway --- buf.gen.yaml | 2 +- gubernator.pb.gw.go | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/buf.gen.yaml b/buf.gen.yaml index 976f5647..c89ac9b6 100755 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -10,7 +10,7 @@ plugins: opt: - paths=source_relative - require_unimplemented_servers=false - - plugin: buf.build/grpc-ecosystem/gateway:v2.19.1 + - plugin: buf.build/grpc-ecosystem/gateway:v2.18.0 # same version in go.mod out: ./ opt: - paths=source_relative diff --git a/gubernator.pb.gw.go b/gubernator.pb.gw.go index 19c0ddab..bb460598 100644 --- a/gubernator.pb.gw.go +++ b/gubernator.pb.gw.go @@ -35,7 +35,11 @@ func request_V1_GetRateLimits_0(ctx context.Context, marshaler runtime.Marshaler var protoReq GetRateLimitsReq var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -48,7 +52,11 @@ func local_request_V1_GetRateLimits_0(ctx context.Context, marshaler runtime.Mar var protoReq GetRateLimitsReq var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) }