[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/03: test_parse_cookies: updated to better match RFC 6
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/03: test_parse_cookies: updated to better match RFC 6265 |
Date: |
Sun, 15 May 2022 19:30:57 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 8643dc6bb903f605520543d15fe9bab05c006910
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun May 15 15:46:28 2022 +0300
test_parse_cookies: updated to better match RFC 6265
The equal sign ('=') is allowed in cookie value.
---
src/testcurl/test_parse_cookies.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/testcurl/test_parse_cookies.c
b/src/testcurl/test_parse_cookies.c
index d124b3a9..af86f14f 100644
--- a/src/testcurl/test_parse_cookies.c
+++ b/src/testcurl/test_parse_cookies.c
@@ -113,6 +113,12 @@ ahc_echo (void *cls,
fprintf (stderr, "'name4' cookie decoded incorrectly.\n");
exit (11);
}
+ hdr = MHD_lookup_connection_value (connection, MHD_COOKIE_KIND, "name5");
+ if ((hdr == NULL) || (0 != strcmp (hdr, "var_with_=_char")))
+ {
+ fprintf (stderr, "'name5' cookie decoded incorrectly.\n");
+ exit (11);
+ }
if (4 != MHD_get_connection_values_n (connection, MHD_COOKIE_KIND,
NULL, NULL))
{
@@ -193,36 +199,32 @@ testExternalGet (int use_invalid)
if (0 == use_invalid)
{
curl_easy_setopt (c, CURLOPT_COOKIE,
- "name1=var1; name2=var2,name3 ;" \
- "name4=\"var4 with spaces\";" \
+ "name1=var1; name2=var2; name3=; " \
+ "name4=\"var4 with spaces\"; " \
+ "name5=var_with_=_char" \
" ; ;; ;");
}
else if (1 == use_invalid)
- {
- curl_easy_setopt (c, CURLOPT_COOKIE,
- "var1=value1=");
- }
- else if (2 == use_invalid)
{
curl_easy_setopt (c, CURLOPT_COOKIE,
"var1=value1;=;");
}
- else if (3 == use_invalid)
+ else if (2 == use_invalid)
{
curl_easy_setopt (c, CURLOPT_COOKIE,
"=");
}
- else if (4 == use_invalid)
+ else if (3 == use_invalid)
{
curl_easy_setopt (c, CURLOPT_COOKIE,
";=");
}
- else if (5 == use_invalid)
+ else if (4 == use_invalid)
{
curl_easy_setopt (c, CURLOPT_COOKIE,
"=;");
}
- else if (6 == use_invalid)
+ else if (5 == use_invalid)
{
curl_easy_setopt (c, CURLOPT_COOKIE,
"a=b,d=c");
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.