Do not uppercase percent-encoded triplets when normalizing URIs
authorSergio Villar Senin <svillar@igalia.com>
Fri, 3 Sep 2010 19:07:30 +0000 (21:07 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Fri, 3 Sep 2010 19:07:30 +0000 (21:07 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=628728

libsoup/soup-uri.c
tests/uri-parsing.c

index a3353a9..e0a9942 100644 (file)
@@ -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 == ' ')
index c5aa6b5..e8568a9 100644 (file)
@@ -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" },