Menu

#1870 Base URL may be wrong

Latest SVN
closed
RBRi
None
1
2017-04-20
2017-04-19
No

In case a page defines a <base> element with an href attribute, the resulting base URL (as provided by HtmlPage.getBaseURL()) may not always be correct. While full URLs and absolute paths in the href attribute are handled correctly, relative paths are not.

Imagine a page URL of http://host/path/to/page.html and a base element with a href of "img/" on that page. The resulting base URLs are as follows:

Looks like browsers resolve relative paths against the current "directory", whereas Htmlunit appends the relative path to the page URL.

Thanks,
J.

Discussion

  • Joerg Werner

    Joerg Werner - 2017-04-19

    See also the attached patch that adds some test cases and tries to fix this issue.

     
  • RBRi

    RBRi - 2017-04-20
    • status: open --> accepted
    • assigned_to: RBRi
     
  • RBRi

    RBRi - 2017-04-20
    • status: accepted --> closed
     
  • RBRi

    RBRi - 2017-04-20

    fixed in svn; thanks (as always)

     

Log in to post a comment.

MongoDB Logo MongoDB