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
()
| 1544 | * @throws Exception if an error occurs |
| 1545 | */ |
| 1546 | @Test |
| 1547 | public void urlEncoding() throws Exception { |
| 1548 | final URL url = new URL("http://host/x+y\u00E9/a\u00E9 b?c \u00E9 d"); |
| 1549 | final HtmlPage page = loadPage(BrowserVersion.FIREFOX, DOCTYPE_HTML + "<html></html>", new ArrayList<>(), url); |
| 1550 | final WebRequest wrs = page.getWebResponse().getWebRequest(); |
| 1551 | assertEquals("http://host/x+y%C3%A9/a%C3%A9%20b?c%20%C3%A9%20d", wrs.getUrl()); |
| 1552 | } |
| 1553 | |
| 1554 | /** |
| 1555 | * Verifies that URLs are automatically encoded before being sent to the server, like |
nothing calls this directly
no test coverage detected