Skip to content

Commit

Permalink
send trailer on error
Browse files Browse the repository at this point in the history
  • Loading branch information
kazegusuri committed Jul 5, 2016
1 parent 04d03d2 commit 5efdfda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ func testABELookupNotFound(t *testing.T) {
if got, want := resp.Header.Get("Grpc-Metadata-Uuid"), uuid; got != want {
t.Errorf("Grpc-Metadata-Uuid was %s, wanted %s", got, want)
}
if got, want := resp.Trailer.Get("Grpc-Trailer-Foo"), "foo2"; got != want {
t.Errorf("Grpc-Trailer-Foo was %q, wanted %q", got, want)
}
if got, want := resp.Trailer.Get("Grpc-Trailer-Bar"), "bar2"; got != want {
t.Errorf("Grpc-Trailer-Bar was %q, wanted %q", got, want)
}
}

func testABEList(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions runtime/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func DefaultHTTPError(ctx context.Context, marshaler Marshaler, w http.ResponseW
}

handleForwardResponseServerMetadata(w, md)
handleForwardResponseTrailerHeader(w, md)
st := HTTPStatusFromCode(grpc.Code(err))
w.WriteHeader(st)
if _, err := w.Write(buf); err != nil {
Expand Down

0 comments on commit 5efdfda

Please sign in to comment.