cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Inconsistent text case using CURLINFO_EFFECTIVE_URL

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 13 May 2014 10:27:19 +0200 (CEST)

On Tue, 13 May 2014, mtroispont_at_hush.com wrote:

> It's a problem because URLs are case sensitive.

Sorry, but that's false. Allow me to quote RFC 3986 section 3.1 about the
"scheme" part (which is what we're talking about here):

    An implementation should accept uppercase letters as equivalent to
    lowercase in scheme names (e.g., allow "HTTP" as well as "http")

I don't think that leaves much interpretation. Do you?

> If the fact that "http://" is lower or uppercase doesn't depend on the
> answer of the remote server (does it?), I expect the result to be
> consistent.

No it doesn't, so yes the results _could_ indeed be made consistent without a
major effort. The differences right now are simply because one of them are
added by the protocol guessing logic and the other by "repairing the URL after
it already knows which protocol it is".

I'm mostly saying this isn't a bug. I still agree that it would be nicer to
use the same lowercase name for all scenarios you show. A matter of niceness,
not correctness.

You feel like producing a patch?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-05-13