[HtmlUnit] [htmlunit:bugs] #1870 Base URL may be wrong

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] [htmlunit:bugs] #1870 Base URL may be wrong

Joerg Werner

[bugs:#1870] Base URL may be wrong

Status: open
Group: Latest SVN
Created: Wed Apr 19, 2017 11:24 AM UTC by Joerg Werner
Last Updated: Wed Apr 19, 2017 11:24 AM UTC
Owner: nobody

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.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] [htmlunit:bugs] #1870 Base URL may be wrong

Joerg Werner

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

Attachments:


[bugs:#1870] Base URL may be wrong

Status: open
Group: Latest SVN
Created: Wed Apr 19, 2017 11:24 AM UTC by Joerg Werner
Last Updated: Wed Apr 19, 2017 11:24 AM UTC
Owner: nobody

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.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] [htmlunit:bugs] #1870 Base URL may be wrong

RBRi-2
In reply to this post by Joerg Werner
  • status: open --> accepted
  • assigned_to: RBRi

[bugs:#1870] Base URL may be wrong

Status: accepted
Group: Latest SVN
Created: Wed Apr 19, 2017 11:24 AM UTC by Joerg Werner
Last Updated: Wed Apr 19, 2017 11:26 AM UTC
Owner: RBRi

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.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] [htmlunit:bugs] #1870 Base URL may be wrong

RBRi-2
In reply to this post by Joerg Werner
  • status: accepted --> closed
  • Comment:

fixed in svn; thanks (as always)


[bugs:#1870] Base URL may be wrong

Status: closed
Group: Latest SVN
Created: Wed Apr 19, 2017 11:24 AM UTC by Joerg Werner
Last Updated: Thu Apr 20, 2017 06:12 AM UTC
Owner: RBRi

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.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop