Skip to content

Commit

Permalink
fix SendHeader/SetTrailer when using grpc-gateway standalone server (#…
Browse files Browse the repository at this point in the history
…1639)

* add ServerTransportStream in context for local gateway handlers

* regenerate files

* fix lint

* fix bazel test

* fix after review
  • Loading branch information
ghostiam committed Sep 3, 2020
1 parent 98d24a7 commit 40c9a89
Show file tree
Hide file tree
Showing 17 changed files with 331 additions and 12 deletions.
1 change: 1 addition & 0 deletions examples/internal/helloworld/BUILD.bazel
Expand Up @@ -35,6 +35,7 @@ go_library(
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//grpclog:go_default_library",
"@org_golang_google_grpc//metadata:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
],
)
34 changes: 33 additions & 1 deletion examples/internal/helloworld/helloworld.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/internal/integration/integration_test.go
Expand Up @@ -46,6 +46,8 @@ func TestEcho(t *testing.T) {
testEchoOneof1(t, 8088, "application/json")
testEchoOneof2(t, 8088, "application/json")
testEchoBody(t, 8088)
// Use SendHeader/SetTrailer without gRPC server https://github.com/grpc-ecosystem/grpc-gateway/issues/517#issuecomment-684625645
testEchoBody(t, 8089)
}

func TestForwardResponseOption(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions examples/internal/proto/examplepb/BUILD.bazel
Expand Up @@ -85,6 +85,7 @@ go_library(
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//grpclog:go_default_library",
"@org_golang_google_grpc//metadata:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
],
)
Expand Down

0 comments on commit 40c9a89

Please sign in to comment.