W3C home > Mailing lists > Public > www-lib@w3.org > July to September 1999

Re: URL misses '/'

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Sat, 10 Jul 1999 15:12:22 -0400
Message-Id: <3.0.5.32.19990710151222.0302caa0@localhost>
To: Vaclav Barta <vbar@comp.cz>, wwwlib <www-lib@w3.org>
At 15:01 10/07/1999 +0000, Vaclav Barta wrote:

>When I call HTLoadAbsolute on "http://localhost", my link callback
>is called for all links on http://localhost/index.html - as
>I'd expect. But when I call HTAnchor_followMainLink on a passed-in
>anchor (like libwww robot does it), I get wrong URL - it misses
>the separator between parent URL and relative name in the page.
>I. e. <a href=php/>php</a> in http://localhost/index.html gets
>mangled into http://localhostphp/ . This happens whether I have
>redirection filter installed or not, on a new snapshot of libwww.
>Any ideas?

The libwww URI parser [1] requires that there is a '/' at the end of all
URIs. The way to get around that is to use the HTParse(..) function (also
in [1]) using PARSE_ALL which canonicalizes the URI and among other things
put a '/' at the end if the path is empty.

Henrik

[1] http://www.w3.org/Library/src/HTParse.html
--
Henrik Frystyk Nielsen,
World Wide Web Consortium
http://www.w3.org/People/Frystyk
Received on Saturday, 10 July 1999 15:12:37 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:16 UTC