Skip to content

Commit a608b28

Browse files
Add failing test for gRPC REST proxy response
1 parent f329ae0 commit a608b28

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/client.rs

+35
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,41 @@ test! {
859859

860860
}
861861

862+
test! {
863+
name: gprc_response_transfer_encoding_chunked,
864+
865+
server:
866+
expected: "\
867+
GET /v1/invoice/16c3d4559f33a65c44fd3419d4f48fb02c9386410118f5cf89669e2f726e1b63 HTTP/1.1\r\n\
868+
host: {addr}\r\n\
869+
\r\n\
870+
",
871+
reply: "\
872+
HTTP/1.1 500 Internal Server Error\r\n\
873+
Content-Type: application/json\r\n\
874+
Trailer: Grpc-Trailer-Content-Type\r\n\
875+
Date: Wed, 01 Apr 2020 00:16:52 GMT\r\n\
876+
Transfer-Encoding: chunked\r\n\
877+
\r\n\
878+
5e\r\n\
879+
{\"error\":\"there are no existing invoices\",\"message\":\"there are no existing invoices\",\"code\":2}\r\n\
880+
0\r\n\
881+
Grpc-Trailer-Content-Type: application/grpc\r\n\
882+
\r\n\
883+
{\"error\":\"there are no existing invoices\",\"message\":\"there are no existing invoices\",\"code\":2}%\r\n\
884+
",
885+
886+
client:
887+
request: {
888+
method: GET,
889+
url: "http://{addr}/v1/invoice/16c3d4559f33a65c44fd3419d4f48fb02c9386410118f5cf89669e2f726e1b63",
890+
},
891+
response:
892+
status: INTERNAL_SERVER_ERROR,
893+
headers: {},
894+
body: None,
895+
}
896+
862897
test! {
863898
name: client_set_host_false,
864899

0 commit comments

Comments
 (0)