Skip to content

Commit

Permalink
Also check for trailers only response
Browse files Browse the repository at this point in the history
Signed-off-by: Sri Krishna Paritala <skrishna@buf.build>
  • Loading branch information
srikrsna-buf committed Sep 3, 2024
1 parent cfe0305 commit 61f7cff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/connect/src/protocol-grpc/validate-trailer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export function validateTrailer(trailer: Headers, header: Headers): void {
});
throw err;
}
if (!trailer.has(headerGrpcStatus) && !trailer.has(headerStatusDetailsBin)) {
if (
!header.has(headerGrpcStatus) &&
!header.has(headerStatusDetailsBin) &&
!trailer.has(headerGrpcStatus) &&
!trailer.has(headerStatusDetailsBin)
) {
throw new ConnectError("protocol error: missing status", Code.Internal);
}
}

0 comments on commit 61f7cff

Please sign in to comment.