[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] Shouldn't wget strip leading spaces from a URL?
From: |
Dale R. Worley |
Subject: |
Re: [Bug-wget] Shouldn't wget strip leading spaces from a URL? |
Date: |
Mon, 05 Jun 2017 21:32:25 -0400 |
L A Walsh <address@hidden> writes:
> if wget gets leading spaces in a URL, it complains:
> " http://www.kernel.org/pub/linux/utils/util-linux/v2.30: Scheme
> missing."
>
> Isn't it required for a web client to strip leading spaces from
> URLs?
Strictly speaking, no, because a URL cannot contain spaces, leading or
otherwise. Generally, Web browsers strip leading and trailing spaces to
make it easier to cut-and-paste links into their location bars, but that
is outside the formality of URLs. In addition, some browsers will
automatically %-escape any character in a purported URL that isn't
allowed in URLs, which makes it easier for people to circulated
purported URLs that contain invalid characters.
But it seems to me that it is better-defined and safer -- and more in
the Un*x tradition -- to have wget simply give an error if the argument
string isn't a valid URL.
Dale