Verifies that URLs are automatically encoded before being sent to the server, like regular browsers do (verified by sniffing HTTP headers). @throws Exception if an error occurs
()
| 1557 | * @throws Exception if an error occurs |
| 1558 | */ |
| 1559 | @Test |
| 1560 | public void urlEncoding2() throws Exception { |
| 1561 | final URL url = new URL("http://host/x+y\u00E9/a\u00E9 b?c \u00E9 d"); |
| 1562 | final HtmlPage page = loadPage(BrowserVersion.BEST_SUPPORTED, |
| 1563 | DOCTYPE_HTML + "<html></html>", new ArrayList<>(), url); |
| 1564 | final WebRequest wrs = page.getWebResponse().getWebRequest(); |
| 1565 | assertEquals("http://host/x+y%C3%A9/a%C3%A9%20b?c%20%C3%A9%20d", wrs.getUrl()); |
| 1566 | } |
| 1567 | |
| 1568 | /** |
| 1569 | * Test that '+' is not encoded in URLs. |
nothing calls this directly
no test coverage detected