curl / Mailing Lists / curl-library / Single Mail


Re: Deprecate falling back to http:// ?

From: Daniel Stenberg via curl-library <>
Date: Wed, 19 Sep 2018 14:00:00 +0200 (CEST)

On Wed, 19 Sep 2018, James Fuller via curl-library wrote:

> the bnf in describes scheme as
> <scheme>:<scheme-specific-part>
> is libcurl consistent in normalising :// after any defined/supported schemes
> ? specifically wondering if the heuristics first check with file:// if no
> scheme is supplied ?

The heuristics first identifies if there is a scheme at all and then it'll use
that scheme as written.

If that scheme isn't supported by this libcurl, then it will return an error -
unless CURLU_NON_SUPPORT_SCHEME is set which asks libcurl to accept it if it
just follows the syntax.

If libcurl sees that there isn't a scheme used at all, it will parse the
string as if "scheme://" had already been passed and then do the scheme
guessing thing.

> otherwise +1 to Erik's response eg. sounds like something to be kept as is
> with the ability to configure fallback.

Right, but if you can change a configuration (we have --proto-default) you can
almost always also opt to just edit the URL and prefix that with the
appropriate scheme =)

But yeah, I figure we don't have a lot to gain by changing the default, mostly
a lot to lose in the shape of broken use cases.

Received on 2018-09-19