@@ -29,9 +29,9 @@ Upstream Patch Reference: https://gitlab.gnome.org/GNOME/libsoup/-/merge_request
2929 libsoup/soup-multipart.c | 4 +-
3030 libsoup/soup-session.c | 4 +-
3131 libsoup/websocket/soup-websocket.c | 28 +-
32- tests/header-parsing-test.c | 257 +++++++++++++-----
32+ tests/header-parsing-test.c | 252 +++++++++++++-----
3333 tests/http2-test.c | 4 +-
34- 20 files changed, 317 insertions(+), 160 deletions(-)
34+ 20 files changed, 311 insertions(+), 161 deletions(-)
3535
3636diff --git a/libsoup/auth/soup-auth-manager.c b/libsoup/auth/soup-auth-manager.c
3737index 402967d..1800190 100644
@@ -535,7 +535,7 @@ index 27257e4..c75b4da 100644
535535
536536 g_ptr_array_add (multipart->headers, headers);
537537diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
538- index 9f00b05..0017cdb 100644
538+ index 649902f..4bca2a4 100644
539539--- a/libsoup/soup-session.c
540540+++ b/libsoup/soup-session.c
541541@@ -1386,10 +1386,10 @@ soup_session_send_queue_item (SoupSession *session,
@@ -651,7 +651,7 @@ index 64e66fd..9863e94 100644
651651 soup_message_headers_remove_common (response_headers,
652652 SOUP_HEADER_SEC_WEBSOCKET_EXTENSIONS);
653653diff --git a/tests/header-parsing-test.c b/tests/header-parsing-test.c
654- index 5e423d2..e81d3b7 100644
654+ index 5e423d2..838baa6 100644
655655--- a/tests/header-parsing-test.c
656656+++ b/tests/header-parsing-test.c
657657@@ -15,6 +15,7 @@ static struct RequestTest {
@@ -1038,7 +1038,7 @@ index 5e423d2..e81d3b7 100644
10381038 },
10391039
10401040 // https://gitlab.gnome.org/GNOME/libsoup/-/issues/377
1041- @@ -437,15 +438,42 @@ static struct RequestTest {
1041+ @@ -437,15 +438,35 @@ static struct RequestTest {
10421042 "GET / HTTP/1.1\r\nHost\x00: example.com\r\n", 36,
10431043 SOUP_STATUS_BAD_REQUEST,
10441044 NULL, NULL, -1,
@@ -1051,39 +1051,33 @@ index 5e423d2..e81d3b7 100644
10511051 SOUP_STATUS_BAD_REQUEST,
10521052 NULL, NULL, -1,
10531053- { { NULL } }
1054+ - }
10541055+ { { NULL } }, 0
1055- }
1056+ + },
10561057+
1057- + { "Only newlines", NULL,
1058- + only_newlines, sizeof (only_newlines),
1059- + SOUP_STATUS_BAD_REQUEST,
1060- + NULL, NULL, -1,
1061- + { { NULL } }, 0
1062- + },
1058+ + { "Duplicate Host headers",
1059+ + "https://gitlab.gnome.org/GNOME/libsoup/-/issues/472",
1060+ + "GET / HTTP/1.1\r\nHost: example.com\r\nHost: example.org\r\n",
1061+ + -1,
1062+ + SOUP_STATUS_BAD_REQUEST,
1063+ + NULL, NULL, -1,
1064+ + { { NULL } },
1065+ + G_LOG_LEVEL_WARNING
1066+ + },
10631067+
1064- + { "Duplicate Host headers",
1065- + "https://gitlab.gnome.org/GNOME/libsoup/-/issues/472",
1066- + "GET / HTTP/1.1\r\nHost: example.com\r\nHost: example.org\r\n",
1067- + -1,
1068- + SOUP_STATUS_BAD_REQUEST,
1069- + NULL, NULL, -1,
1070- + { { NULL } },
1071- + G_LOG_LEVEL_WARNING
1072- + },
1073- +
1074- + { "Duplicate Host headers, case insensitive",
1075- + "https://gitlab.gnome.org/GNOME/libsoup/-/issues/472",
1076- + "GET / HTTP/1.1\r\nHost: example.com\r\nhost: example.org\r\n",
1077- + -1,
1078- + SOUP_STATUS_BAD_REQUEST,
1079- + NULL, NULL, -1,
1080- + { { NULL } },
1081- + G_LOG_LEVEL_WARNING
1082- + }
1068+ + { "Duplicate Host headers, case insensitive",
1069+ + "https://gitlab.gnome.org/GNOME/libsoup/-/issues/472",
1070+ + "GET / HTTP/1.1\r\nHost: example.com\r\nhost: example.org\r\n",
1071+ + -1,
1072+ + SOUP_STATUS_BAD_REQUEST,
1073+ + NULL, NULL, -1,
1074+ + { { NULL } },
1075+ + G_LOG_LEVEL_WARNING
1076+ + }
10831077 };
10841078 static const int num_reqtests = G_N_ELEMENTS (reqtests);
10851079
1086- @@ -892,10 +920 ,17 @@ do_request_tests (void)
1080+ @@ -892,10 +913 ,17 @@ do_request_tests (void)
10871081 len = strlen (reqtests[i].request);
10881082 else
10891083 len = reqtests[i].length;
@@ -1101,7 +1095,7 @@ index 5e423d2..e81d3b7 100644
11011095 if (SOUP_STATUS_IS_SUCCESSFUL (status)) {
11021096 g_assert_cmpstr (method, ==, reqtests[i].method);
11031097 g_assert_cmpstr (path, ==, reqtests[i].path);
1104- @@ -1245,16 +1280 ,21 @@ do_append_param_tests (void)
1098+ @@ -1245,16 +1273 ,21 @@ do_append_param_tests (void)
11051099
11061100 static const struct {
11071101 const char *description, *name, *value;
@@ -1133,7 +1127,7 @@ index 5e423d2..e81d3b7 100644
11331127 };
11341128
11351129 static void
1136- @@ -1264,15 +1304 ,105 @@ do_bad_header_tests (void)
1130+ @@ -1264,15 +1297 ,105 @@ do_bad_header_tests (void)
11371131 int i;
11381132
11391133 hdrs = soup_message_headers_new (SOUP_MESSAGE_HEADERS_MULTIPART);
@@ -1166,7 +1160,7 @@ index 5e423d2..e81d3b7 100644
11661160+ soup_message_headers_append (hdrs, bad_header_values[i].name,
11671161+ bad_header_values[i].value);
11681162+ g_test_assert_expected_messages ();
1169- }
1163+ + }
11701164+
11711165+ /* soup_message_headers_replace: bad values */
11721166+ for (i = 0; i < G_N_ELEMENTS (bad_header_values); i++) {
@@ -1177,7 +1171,7 @@ index 5e423d2..e81d3b7 100644
11771171+ soup_message_headers_replace (hdrs, bad_header_values[i].name,
11781172+ bad_header_values[i].value);
11791173+ g_test_assert_expected_messages ();
1180- + }
1174+ }
11811175+
11821176+ /* soup_message_headers_set_content_type: bad values */
11831177+ for (i = 0; i < G_N_ELEMENTS (bad_header_values); i++) {
@@ -1247,7 +1241,7 @@ index 5e423d2..e81d3b7 100644
12471241 soup_message_headers_unref (hdrs);
12481242 }
12491243
1250- @@ -1291,6 +1421 ,7 @@ main (int argc, char **argv)
1244+ @@ -1291,6 +1414 ,7 @@ main (int argc, char **argv)
12511245 g_test_add_func ("/header-parsing/content-type", do_content_type_tests);
12521246 g_test_add_func ("/header-parsing/append-param", do_append_param_tests);
12531247 g_test_add_func ("/header-parsing/bad", do_bad_header_tests);
@@ -1271,5 +1265,5 @@ index 92944d6..6fa63e9 100644
12711265 } else if (strcmp (path, "/invalid-header-rfc9113") == 0) {
12721266 SoupMessageHeaders *response_headers;
12731267- -
1274- 2.45.4
1268+ 2.43.0
12751269
0 commit comments