avikpaul / google-url

Automatically exported from code.google.com/p/google-url
Other
0 stars 0 forks source link

HEX-digits case ("%3a" vs. "%3A") #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In RFC 3986 section 6 (http://tools.ietf.org/html/rfc3986#section-6) we  read:

"
6.2.2.1.  Case Normalization

   For all URIs, the hexadecimal digits within a percent-encoding
   triplet (e.g., "%3a" versus "%3A") are case-insensitive and therefore
   should be normalized to use uppercase letters for the digits A-F.
"

But this library does not do that!

Original issue reported on code.google.com by s2...@land.ru on 10 May 2012 at 8:18

GoogleCodeExporter commented 9 years ago
This is in case when I try to normalize some URL that already percent-encoded 
with lowercase letters (a-f)

Original comment by s2...@land.ru on 10 May 2012 at 12:40

GoogleCodeExporter commented 9 years ago
We'll do this canonicalization for the path but not the query. Sites tend to be 
more sensitive to query changes and we try not to change anything unless it's 
dangerous. IE doesn't do this either. I doubt we can make this change without 
breaking anything.

Original comment by bre...@gmail.com on 10 May 2012 at 2:36

GoogleCodeExporter commented 9 years ago
OK.
I will use url_util::DecodeURLEscapeSequences() and then create new GURL on 
result.

Original comment by s2...@land.ru on 11 May 2012 at 5:48

GoogleCodeExporter commented 9 years ago
If you want "really canonical" that's probably a better approach. It will 
additionally canonicalize escaped ASCII, which we also don't change in the 
query part. Sadly, some servers are very sensitive to exactly what's in the 
query since random people write programs to interpret it in different ways,

Original comment by bre...@gmail.com on 11 May 2012 at 5:04

GoogleCodeExporter commented 9 years ago
It is OK in my case.
I need extra-normalised URL for GUID generation. It should not be 
semantic-safe. It is addition to GURL::spec() of original URL.

Original comment by s2...@land.ru on 12 May 2012 at 12:14