summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2019-01-09 16:07:06 +0000
committerHåvard Pettersen <havardpe@oath.com>2019-01-09 16:07:06 +0000
commitc2122f0ebf10d3b29f9b61e1bdf3f89a13fac899 (patch)
tree0af7d7d09132aff55caa78ffd6720296f119b991 /vespalib
parent4543ea32f9efaf603b5b0a269404a95c5fd83a01 (diff)
some extra testing
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/portal/http_request/http_request_test.cpp12
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(); }