diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-12-09 09:34:01 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-12-09 09:34:01 -0800 |
commit | 3ebb7cc10714178e540383d3970e2ebddcfab8a7 (patch) | |
tree | 1aa8a7293afb97548bcb1a2e77024ec84712af87 /test/core/bad_client | |
parent | aa5a61e888c168ff8fc78847e43bdbf0592df76c (diff) |
Hit some esoteric request header paths
Diffstat (limited to 'test/core/bad_client')
-rw-r--r-- | test/core/bad_client/tests/simple_request.c | 16 | ||||
-rw-r--r-- | test/core/bad_client/tests/simple_request_unusual.headers | 11 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/core/bad_client/tests/simple_request.c b/test/core/bad_client/tests/simple_request.c index b6c3b65ac3..5ded520fee 100644 --- a/test/core/bad_client/tests/simple_request.c +++ b/test/core/bad_client/tests/simple_request.c @@ -55,6 +55,21 @@ "\x10\x02te\x08trailers" \ "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)" +#define PFX_STR_UNUSUAL \ + "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \ + "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */ \ + "\x00\x00\xd1\x01\x04\x00\x00\x00\x01" /* headers: generated from \ + simple_request_unusual.headers \ + in this directory */ \ + "\x10\x05:path\x08/foo/bar" \ + "\x10\x07:scheme\x04http" \ + "\x10\x07:method\x04POST" \ + "\x10\x04host\x09localhost" \ + "\x10\x0c""content-type\x1e""application/grpc+this-is-valid" \ + "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip" \ + "\x10\x02te\x08trailers" \ + "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)" + static void *tag(gpr_intptr t) { return (void *)t; } static void verifier(grpc_server *server, grpc_completion_queue *cq) { @@ -87,6 +102,7 @@ int main(int argc, char **argv) { /* basic request: check that things are working */ GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR, 0); + GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR_UNUSUAL, 0); /* push an illegal data frame */ GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR diff --git a/test/core/bad_client/tests/simple_request_unusual.headers b/test/core/bad_client/tests/simple_request_unusual.headers new file mode 100644 index 0000000000..6750302f5c --- /dev/null +++ b/test/core/bad_client/tests/simple_request_unusual.headers @@ -0,0 +1,11 @@ +# headers used in simple_request.c +# use tools/codegen/core/gen_header_frame.py to generate the binary strings +# contained in the source code +:path: /foo/bar +:scheme: http +:method: POST +host: localhost +content-type: application/grpc+this-is-valid +grpc-accept-encoding: identity,deflate,gzip +te: trailers +user-agent: bad-client grpc-c/0.12.0.0 (linux) |