Skip to content

Commit

Permalink
support allow_delete_body for protoc-gen-grpc-gateway
Browse files Browse the repository at this point in the history
this fixes up grpc-ecosystem#280
  • Loading branch information
flisky committed Feb 28, 2017
1 parent f3aa758 commit f7f3e78
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 f7f3e78

Please sign in to comment.