Skip to content

Commit

Permalink
support allow_delete_body for protoc-gen-grpc-gateway (grpc-ecosystem…
Browse files Browse the repository at this point in the history
  • Loading branch information
flisky authored and tmc committed May 12, 2017
1 parent ff85230 commit 88bce48
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions protoc-gen-grpc-gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
var (
importPrefix = flag.String("import_prefix", "", "prefix to be added to go package paths for imported proto files")
useRequestContext = flag.Bool("request_context", false, "determine whether to use http.Request's context or not")
allowDeleteBody = flag.Bool("allow_delete_body", false, "unless set, HTTP DELETE methods may not have a body")
)

func parseReq(r io.Reader) (*plugin.CodeGeneratorRequest, error) {
Expand Down Expand Up @@ -77,6 +78,7 @@ func main() {
g := gengateway.New(reg, *useRequestContext)

reg.SetPrefix(*importPrefix)
reg.SetAllowDeleteBody(*allowDeleteBody)
if err := reg.Load(req); err != nil {
emitError(err)
return
Expand Down

0 comments on commit 88bce48

Please sign in to comment.