We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I made a simple modification to the echo example in which I use a message that is type bytes:
message BytesMessage { bytes id =1; }
Changed the proto for EchoBody to use BytesMessage:
EchoBody
BytesMessage
rpc EchoBody(BytesMessage) returns (BytesMessage) { option (google.api.http) = { post: "/v1/example/echo_body" body: "*" }; }
Modified echo.go:EchoBody to be:
echo.go:EchoBody
func (s *echoServer) EchoBody(ctx context.Context, msg *examples.BytesMessage) (*examples.BytesMessage, error) {
And then when I send invalid information:
➜ curl -X POST -k http://localhost:8080/v1/example/echo_body -H "Content-Type: text/plain" -d '{"id": "notbase64"}'` {"error":"illegal base64 data at input byte 8","code":3}% ➜
It panics:
➜ ./examples panic: net/http: CloseNotify called after ServeHTTP finished goroutine 7 [running]: panic(0x7efa00, 0xc82000bd00) /usr/lib/go/src/runtime/panic.go:464 +0x3e6 net/http.(*response).CloseNotify(0xc8201101a0, 0x0) /usr/lib/go/src/net/http/server.go:1535 +0x9d github.com/gengo/grpc-gateway/examples/examplepb.RegisterEchoServiceHandler.func2.1(0x7fdb33c0ae98, 0xc8201101a0, 0xc82000bbc0) /home/diogo/go/src/github.com/gengo/grpc-gateway/examples/examplepb/echo_service.pb.gw.go:127 +0x27 created by github.com/gengo/grpc-gateway/examples/examplepb.RegisterEchoServiceHandler.func2 /home/diogo/go/src/github.com/gengo/grpc-gateway/examples/examplepb/echo_service.pb.gw.go:129 +0x132
The text was updated successfully, but these errors were encountered:
Maybe fixed by #120
Sorry, something went wrong.
No branches or pull requests
I made a simple modification to the echo example in which I use a message that is type bytes:
Changed the proto for
EchoBody
to useBytesMessage
:Modified
echo.go:EchoBody
to be:And then when I send invalid information:
It panics:
The text was updated successfully, but these errors were encountered: