[libsoup] Do not uppercase percent-encoded triplets when normalizing URIs



commit b4f2a4d9d69101dacdc0138c2ed93de8c8ca2368
Author: Sergio Villar Senin <svillar igalia com>
Date:   Fri Sep 3 21:07:30 2010 +0200

    Do not uppercase percent-encoded triplets when normalizing URIs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=628728

 libsoup/soup-uri.c  |    8 ++++++--
 tests/uri-parsing.c |    2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c
index a3353a9..e0a9942 100644
--- a/libsoup/soup-uri.c
+++ b/libsoup/soup-uri.c
@@ -671,9 +671,13 @@ uri_normalized_copy (const char *part, int length,
 				*d++ = c;
 				s += 2;
 			} else {
+				/* We leave it unchanged. We used to uppercase percent-encoded
+				 * triplets but we do not do it any more as RFC3986 Section 6.2.2.1
+				 * says that they only SHOULD be case normalized.
+				 */
 				*d++ = *s++;
-				*d++ = g_ascii_toupper (*s++);
-				*d++ = g_ascii_toupper (*s);
+				*d++ = *s++;
+				*d++ = *s;
 			}
 		} else {
 			if (*s == ' ')
diff --git a/tests/uri-parsing.c b/tests/uri-parsing.c
index c5aa6b5..e8568a9 100644
--- a/tests/uri-parsing.c
+++ b/tests/uri-parsing.c
@@ -140,7 +140,7 @@ static int num_rel_tests = G_N_ELEMENTS(rel_tests);
 static struct {
 	const char *one, *two;
 } eq_tests[] = {
-	{ "example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d" },
+	{ "example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7Bfoo%7D" },
 	{ "http://example.com";, "http://example.com/"; },
 	/* From RFC 2616 */
 	{ "http://abc.com:80/~smith/home.html";, "http://abc.com:80/~smith/home.html"; },



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]