Skip to content

Commit

Permalink
Merge pull request #2 from mpl/master
Browse files Browse the repository at this point in the history
Catch and report non HTTP/2 error case
  • Loading branch information
bradfitz authored Feb 4, 2017
2 parents 188a132 + 7206c86 commit 4d918e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions call.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ func (cc *ClientConn) invoke(ctx context.Context, method string, args, reply int
}
defer res.Body.Close()

if !res.ProtoAtLeast(2, 0) {
return Errorf(codes.Internal, "grpc: HTTP/2 required; response was %v", res.Proto)
}
if res.StatusCode != 200 {
return Errorf(codes.Internal, "grpc: unexpected status code %v", res.Status)
}
Expand Down

0 comments on commit 4d918e3

Please sign in to comment.