diff options
author | Håvard Pettersen <havardpe@oath.com> | 2019-01-09 16:07:06 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2019-01-09 16:07:06 +0000 |
commit | c2122f0ebf10d3b29f9b61e1bdf3f89a13fac899 (patch) | |
tree | 0af7d7d09132aff55caa78ffd6720296f119b991 /vespalib | |
parent | 4543ea32f9efaf603b5b0a269404a95c5fd83a01 (diff) |
some extra testing
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/tests/portal/http_request/http_request_test.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vespalib/src/tests/portal/http_request/http_request_test.cpp b/vespalib/src/tests/portal/http_request/http_request_test.cpp index d369dc274c4..047fde5750c 100644 --- a/vespalib/src/tests/portal/http_request/http_request_test.cpp +++ b/vespalib/src/tests/portal/http_request/http_request_test.cpp @@ -160,4 +160,16 @@ TEST("require that percent character becomes plain if not followed by exactly 2 EXPECT_TRUE(req.has_param("%")); } +TEST("require that last character of uri segments (path, key, value) can be quoted") { + auto req = make_request("GET /%41?%42=%43 HTTP/1.1\r\n\r\n"); + EXPECT_EQUAL(req.get_path(), "/A"); + EXPECT_EQUAL(req.get_param("B"), "C"); +} + +TEST("require that additional query and key/value separators are not special") { + auto req = make_request("GET /?" "?== HTTP/1.1\r\n\r\n"); + EXPECT_EQUAL(req.get_path(), "/"); + EXPECT_EQUAL(req.get_param("?"), "="); +} + TEST_MAIN() { TEST_RUN_ALL(); } |