Curl Global Community
valid Url hostname - Printable Version

+- Curl Global Community (https://communities.curl.com)
+-- Forum: Blogs (https://communities.curl.com/forumdisplay.php?fid=17)
+--- Forum: Tech blog (https://communities.curl.com/forumdisplay.php?fid=18)
+---- Forum: Robert blog (https://communities.curl.com/forumdisplay.php?fid=20)
+---- Thread: valid Url hostname (/showthread.php?tid=524)



valid Url hostname - RobertShiplett - 06-10-2012

In converting a plain HTML-only home page to a Curl page I made a discovery (to me, at least.)

In Canada, from my Cdn IP, the only path to google.com instead of google.ca is to concat a query.

Browsers accept the HTML anchor href of https://www.google.com?q=
but they silently convert it to https://www.google.com/?q=

But Curl rejects the former - even when using {url-encode-string maybe-has-query? = true,

The hostname will prove invalid. Creating a URL and then using set-query is of no avail.

But this will work : https://www.google.com/?q=

and with one forward slash after the top-level we have a valid hostname.

And yet, in Curl we do get away with

{link href={url "http://www.bbc.co.uk"} || ...

for modest inconsistency in parsing 'What Is A Valid Hostname?' ... or not?