diff options
author | Seonah Moon <seonah1.moon@samsung.com> | 2020-03-23 09:28:57 +0900 |
---|---|---|
committer | Seonah Moon <seonah1.moon@samsung.com> | 2020-03-23 10:34:25 +0900 |
commit | 57aca048f552d3938246c93558122872cfe87176 (patch) | |
tree | c571a37bd29d6315901a749ebb7a5b165c070d33 /tests/server-test.c | |
parent | 88ea598667b311507eae04bc74ac7fd83eb7b97b (diff) | |
parent | b74c5fd5483969d55625576448662edf864b6b9e (diff) | |
download | libsoup-57aca048f552d3938246c93558122872cfe87176.tar.gz libsoup-57aca048f552d3938246c93558122872cfe87176.tar.bz2 libsoup-57aca048f552d3938246c93558122872cfe87176.zip |
Merge upstream/2.69.90 into tizentizen_6.0.m2_releasesubmit/tizen_6.0_hotfix/20201103.115102submit/tizen_6.0_hotfix/20201102.192902submit/tizen_6.0/20201029.205502submit/tizen/20200323.083458accepted/tizen/unified/20200325.055642accepted/tizen/6.0/unified/hotfix/20201103.045615accepted/tizen/6.0/unified/hotfix/20201102.234915accepted/tizen/6.0/unified/20201030.105459tizen_6.0_hotfixtizen_6.0accepted/tizen_6.0_unified_hotfixaccepted/tizen_6.0_unified
Change-Id: Idf12fd1a95024d5d13a447d3a8ce6dd88f797207
Diffstat (limited to 'tests/server-test.c')
-rw-r--r-- | tests/server-test.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/server-test.c b/tests/server-test.c index cf132b33..8976103e 100644 --- a/tests/server-test.c +++ b/tests/server-test.c @@ -275,6 +275,72 @@ do_dot_dot_test (ServerData *sd, gconstpointer test_data) soup_test_assert_message_status (msg, SOUP_STATUS_BAD_REQUEST); g_object_unref (msg); + uri = soup_uri_new_with_base (sd->base_uri, "/%2e%2e%2ftest"); + msg = soup_message_new_from_uri ("GET", uri); + soup_uri_free (uri); + + soup_session_send_message (session, msg); + soup_test_assert_message_status (msg, SOUP_STATUS_BAD_REQUEST); + g_object_unref (msg); + +#ifdef G_OS_WIN32 + uri = soup_uri_new_with_base (sd->base_uri, "\\..%5Ctest"); + msg = soup_message_new_from_uri ("GET", uri); + soup_uri_free (uri); + + soup_session_send_message (session, msg); + soup_test_assert_message_status (msg, SOUP_STATUS_BAD_REQUEST); + g_object_unref (msg); + + uri = soup_uri_new_with_base (sd->base_uri, "\\../test"); + msg = soup_message_new_from_uri ("GET", uri); + soup_uri_free (uri); + + soup_session_send_message (session, msg); + soup_test_assert_message_status (msg, SOUP_STATUS_BAD_REQUEST); + g_object_unref (msg); + + uri = soup_uri_new_with_base (sd->base_uri, "%5C..%2ftest"); + msg = soup_message_new_from_uri ("GET", uri); + soup_uri_free (uri); + + soup_session_send_message (session, msg); + soup_test_assert_message_status (msg, SOUP_STATUS_BAD_REQUEST); + g_object_unref (msg); + + uri = soup_uri_new_with_base (sd->base_uri, "/..\\test"); + msg = soup_message_new_from_uri ("GET", uri); + soup_uri_free (uri); + + soup_session_send_message (session, msg); + soup_test_assert_message_status (msg, SOUP_STATUS_BAD_REQUEST); + g_object_unref (msg); + + uri = soup_uri_new_with_base (sd->base_uri, "%2f..%5Ctest"); + msg = soup_message_new_from_uri ("GET", uri); + soup_uri_free (uri); + + soup_session_send_message (session, msg); + soup_test_assert_message_status (msg, SOUP_STATUS_BAD_REQUEST); + g_object_unref (msg); + + uri = soup_uri_new_with_base (sd->base_uri, "\\%2e%2e%5ctest"); + msg = soup_message_new_from_uri ("GET", uri); + soup_uri_free (uri); + + soup_session_send_message (session, msg); + soup_test_assert_message_status (msg, SOUP_STATUS_BAD_REQUEST); + g_object_unref (msg); + + uri = soup_uri_new_with_base (sd->base_uri, "\\..%%35%63..%%35%63test"); + msg = soup_message_new_from_uri ("GET", uri); + soup_uri_free (uri); + + soup_session_send_message (session, msg); + soup_test_assert_message_status (msg, SOUP_STATUS_BAD_REQUEST); + g_object_unref (msg); +#endif + soup_test_session_abort_unref (session); } |