emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

url-encode-url: do not add a trailing slash for "bare" URLs (with no fil


From: Bastien
Subject: url-encode-url: do not add a trailing slash for "bare" URLs (with no file/directory)
Date: Wed, 12 Mar 2014 11:19:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

For now url-encode-url does this:

(url-encode-url "http://www.gnu.org";)
   => http://www.gnu.org/

I suggest to not add the trailing slash:

(url-encode-url "http://www.gnu.org";)
   => http://www.gnu.org

Adding a trailing slash is only recommended when there is a directory
after the domain name, like in "http://www.gnu.org/software";, which
should be written "http://www.gnu.org/software/";.

For now url-encode-url is right about *not* adding the trailing slash
in the above case (as this would lead to too many false positives) but
wrong in adding it for http://www.gnu.org, as this disambiguation is
not needed.

Am I missing cases when it is definitely needed?

The following trivial patch changes this.

Attachment: url-parse.el.patch
Description: Text Data

-- 
 Bastien

reply via email to

[Prev in Thread] Current Thread [Next in Thread]