Skip to content

Commit

Permalink
Handle httpbody not having data to return
Browse files Browse the repository at this point in the history
  • Loading branch information
achew22 authored and johanbrandhorst committed Jul 23, 2023
1 parent dd7c267 commit cdd1586
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/marshal_httpbodyproto.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (h *HTTPBodyMarshaler) ContentType(v interface{}) string {
// google.api.HttpBody message, otherwise it falls back to the default Marshaler.
func (h *HTTPBodyMarshaler) Marshal(v interface{}) ([]byte, error) {
if httpBody, ok := v.(*httpbody.HttpBody); ok {
return httpBody.Data, nil
return httpBody.GetData(), nil
}
return h.Marshaler.Marshal(v)
}

0 comments on commit cdd1586

Please sign in to comment.