[HtmlUnit] [htmlunit:bugs] #1973 URLs are not properly encoded as UTF-8
RBRi via HtmlUnit-develop <[email protected]> Thu, 19 Jul 2018 19:12:40 -0000
| Newsgroups | gmane.comp.java.htmlunit.devel |
|---|---|
| Message-ID | </p/htmlunit/bugs/1973/52875ee42b2e4a610ba2b8d907225a526ffbdac4.bugs@htmlunit.p.sourceforge.net> |
Thanks for the report, hopefully i have addressed the issue in the right way, was not that simple and many of our test expectations where outdated. Please try the latest snapshot build and report if it now works for you.
Thanks for using HtmlUnit
---
** [bugs:#1973] URLs are not properly encoded as UTF-8**
**Status:** accepted
**Group:** 2.31
**Created:** Thu Jul 12, 2018 01:42 AM UTC by Thrawn
**Last Updated:** Thu Jul 12, 2018 05:45 PM UTC
**Owner:** RBRi
HTMLUnit is not properly encoding UTF-8 request URLs. This causes failures when servers strictly validate those URLs.
Minimal test case:
- A Spring controller that calls HttpServletRequest.getParameterMap(), such as:
@RequestMapping(value = "/", method = {RequestMethod.GET, RequestMethod.HEAD})
public String welcome(HttpServletRequest request) {
request.getParameterMap();
return "index";
}
- Run on Jetty 9.4.x (9.4.9.v20180320 and 9.4.11.v20180605 are confirmed), eg using the Jetty Maven plugin
- Run a unit test that creates a Selenium HTMLUnitDriver and attempts to load /?param=Publisher`s\u2013\u00a0Internationalé\u2014Pty\u00a9Ltd
Expected: The page loads and ignores the parameter
Actual: A server error occurs, reporting:
org.eclipse.jetty.util.Utf8Appendable$NotUtf8Exception: Not valid UTF8! byte A0 in state 0
at org.eclipse.jetty.util.Utf8Appendable.appendByte (Utf8Appendable.java:253)
at org.eclipse.jetty.util.Utf8Appendable.append (Utf8Appendable.java:158)
at org.eclipse.jetty.util.UrlEncoded.decodeUtf8To (UrlEncoded.java:354)
at org.eclipse.jetty.util.UrlEncoded.decodeUtf8To (UrlEncoded.java:296)
at org.eclipse.jetty.http.HttpURI.decodeQueryTo (HttpURI.java:615)
at org.eclipse.jetty.server.Request.extractQueryParameters (Request.java:437)
at org.eclipse.jetty.server.Request.getParameters (Request.java:401)
at org.eclipse.jetty.server.Request.getParameterMap (Request.java:1035)
---
Sent from sourceforge.net because [email protected] 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop