aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-04-27 16:29:14 -0700
committerGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-04-27 16:29:14 -0700
commit081ad7a437f97fb0e4696e608fa7254a0a6f36a5 (patch)
tree2fb8f72473bb5993ab29e4be47d4efdbdaa79336 /test
parentcca098e77c3a84ba2109856a277df31224dceb60 (diff)
parent1f3319bc88009355a07cbc757e007a659c5beaf8 (diff)
Merge pull request #6295 from markdroth/content_type_semicolon2
Change C implementation to not log an "Unexpected content-type" message when the header includes a semicolon.
Diffstat (limited to 'test')
-rw-r--r--test/core/bad_client/tests/server_registered_method.headers2
-rw-r--r--test/core/bad_client/tests/simple_request.c22
-rw-r--r--test/core/bad_client/tests/simple_request_unusual2.headers13
3 files changed, 36 insertions, 1 deletions
diff --git a/test/core/bad_client/tests/server_registered_method.headers b/test/core/bad_client/tests/server_registered_method.headers
index 06ee73c82e..2640cc9cb8 100644
--- a/test/core/bad_client/tests/server_registered_method.headers
+++ b/test/core/bad_client/tests/server_registered_method.headers
@@ -1,4 +1,4 @@
-# headers used in simple_request.c
+# headers used in server_registered_method.c
# use tools/codegen/core/gen_header_frame.py to generate the binary strings
# contained in the source code
:path: /registered/bar
diff --git a/test/core/bad_client/tests/simple_request.c b/test/core/bad_client/tests/simple_request.c
index ac0fdde876..3ae6eb3592 100644
--- a/test/core/bad_client/tests/simple_request.c
+++ b/test/core/bad_client/tests/simple_request.c
@@ -77,6 +77,27 @@
"\x10\x0cgrpc-timeout\x02" \
"5S"
+#define PFX_STR_UNUSUAL2 \
+ "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\xf4\x01\x04\x00\x00\x00\x01" /* headers: generated from \
+ simple_request_unusual2.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)" \
+ "\x10\x0cgrpc-timeout\x03" \
+ "10S" \
+ "\x10\x0cgrpc-timeout\x02" \
+ "5S"
+
static void *tag(intptr_t t) { return (void *)t; }
static void verifier(grpc_server *server, grpc_completion_queue *cq,
@@ -120,6 +141,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);
+ GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR_UNUSUAL2, 0);
/* push an illegal data frame */
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR
diff --git a/test/core/bad_client/tests/simple_request_unusual2.headers b/test/core/bad_client/tests/simple_request_unusual2.headers
new file mode 100644
index 0000000000..f70920f372
--- /dev/null
+++ b/test/core/bad_client/tests/simple_request_unusual2.headers
@@ -0,0 +1,13 @@
+# 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: deflate,identity,gzip
+te: trailers
+user-agent: bad-client grpc-c/0.12.0.0 (linux)
+grpc-timeout: 10S
+grpc-timeout: 5S