fix(cmd/protoc-gen-go-http): follow the http rule to use query strings (#1629)

pull/1633/head
Giovanny Gutiérrez 3 years ago committed by GitHub
parent 268243d8a3
commit 7a52468ea8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      cmd/protoc-gen-go-http/template.go

@ -30,6 +30,12 @@ func _{{$svrType}}_{{.Name}}{{.Num}}_HTTP_Handler(srv {{$svrType}}HTTPServer) fu
if err := ctx.Bind(&in{{.Body}}); err != nil {
return err
}
{{- if not (eq .Body "")}}
if err := ctx.BindQuery(&in); err != nil {
return err
}
{{- end}}
{{- else}}
if err := ctx.BindQuery(&in{{.Body}}); err != nil {
return err

Loading…
Cancel
Save