use of org.apache.tomcat.unittest.TesterRequest in project tomcat70 by apache.
the class TestResponse method testBug53062g.
@Test
public void testBug53062g() throws Exception {
Request req = new TesterRequest();
Response resp = new Response();
resp.setRequest(req);
String result = resp.toAbsolute("bar.html?x=/../");
Assert.assertEquals("http://localhost:8080/level1/level2/bar.html?x=/../", result);
}
use of org.apache.tomcat.unittest.TesterRequest in project tomcat70 by apache.
the class TestResponse method doTestEncodeURL.
private void doTestEncodeURL(String location, String expected) {
Request req = new TesterRequest(true);
req.setRequestedSessionId("1234");
req.setRequestedSessionURL(true);
Response resp = new Response();
resp.setRequest(req);
String result = resp.encodeURL(location);
Assert.assertEquals(expected, result);
}
use of org.apache.tomcat.unittest.TesterRequest in project tomcat70 by apache.
the class TestResponse method testBug53062d.
@Test
public void testBug53062d() throws Exception {
Request req = new TesterRequest();
Response resp = new Response();
resp.setRequest(req);
String result = resp.toAbsolute(".././..");
Assert.assertEquals("http://localhost:8080/", result);
}
use of org.apache.tomcat.unittest.TesterRequest in project tomcat70 by apache.
the class TestResponse method testBug53062h.
@Test
public void testBug53062h() throws Exception {
Request req = new TesterRequest();
Response resp = new Response();
resp.setRequest(req);
String result = resp.toAbsolute("bar.html?x=/../../");
Assert.assertEquals("http://localhost:8080/level1/level2/bar.html?x=/../../", result);
}
use of org.apache.tomcat.unittest.TesterRequest in project tomcat70 by apache.
the class TestResponse method testBug53062f.
@Test
public void testBug53062f() throws Exception {
Request req = new TesterRequest();
Response resp = new Response();
resp.setRequest(req);
String result = resp.toAbsolute("bar.html");
Assert.assertEquals("http://localhost:8080/level1/level2/bar.html", result);
}
Aggregations