Relative links starting with ?
Brought to you by:
derrickoswald
Give a base url of http://www.foobar.com/foo and
relative link of ?a=b, the URL spec specifies that the
absolute URL should be http://www.foobar.com/?a=b.
However, this is not how browsers work.
For an example, see the page links at the bottom of
http://technorati.com/search/idol
I suggest a patch to Page.java line 846
- url = new URL (new URL (base), link);
+ url = base.charAt(0) == '?' ? new URL(base +
link) : new URL (new URL (base), link);
Logged In: YES
user_id=1490288
whoops. typo. the correct replacement line should be
url = link.charAt(0) == '?' ? new URL(base + link) : new URL
(new URL (base), link);
Logged In: YES
user_id=605407
Added overloaded methods taking boolean 'strict' flag on URL
manipulators.
Default is loose interpretation like most browsers.