Skip to content

Commit 43b3edb

Browse files
authored
Add return statement to example (#942)
As stated, the example would have grpc-web requests execute twice. Adding return to exit handler once grpc-web request is executed
1 parent 84ab65f commit 43b3edb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

go/grpcweb/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Here's an example of how to use it inside an existing gRPC Go server on a separa
1717
tlsHttpServer.Handler = http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
1818
if wrappedGrpc.IsGrpcWebRequest(req) {
1919
wrappedGrpc.ServeHTTP(resp, req)
20+
return
2021
}
2122
// Fall back to other servers.
2223
http.DefaultServeMux.ServeHTTP(resp, req)

0 commit comments

Comments
 (0)