From f7f3e78da3bde62c2e54ac45f3009c0471251b7a Mon Sep 17 00:00:00 2001 From: Yin Jifeng Date: Tue, 28 Feb 2017 15:59:31 +0800 Subject: [PATCH] support allow_delete_body for protoc-gen-grpc-gateway this fixes up #280 --- protoc-gen-grpc-gateway/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/protoc-gen-grpc-gateway/main.go b/protoc-gen-grpc-gateway/main.go index 0e2c54f8b26..cf365f249e1 100644 --- a/protoc-gen-grpc-gateway/main.go +++ b/protoc-gen-grpc-gateway/main.go @@ -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) { @@ -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