Merge branch 'jetty-7' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project into jetty-7
This commit is contained in:
commit
2693829f23
|
@ -468,15 +468,23 @@ public class Response implements HttpServletResponse
|
||||||
{
|
{
|
||||||
buf = _connection.getRequest().getRootURL();
|
buf = _connection.getRequest().getRootURL();
|
||||||
buf.append(URIUtil.encodePath(canonical));
|
buf.append(URIUtil.encodePath(canonical));
|
||||||
if (uri.getQuery()!=null)
|
String param=uri.getParam();
|
||||||
|
if (param!=null)
|
||||||
|
{
|
||||||
|
buf.append(';');
|
||||||
|
buf.append(param);
|
||||||
|
}
|
||||||
|
String query=uri.getQuery();
|
||||||
|
if (query!=null)
|
||||||
{
|
{
|
||||||
buf.append('?');
|
buf.append('?');
|
||||||
buf.append(uri.getQuery());
|
buf.append(query);
|
||||||
}
|
}
|
||||||
if (uri.getFragment()!=null)
|
String fragment=uri.getFragment();
|
||||||
|
if (fragment!=null)
|
||||||
{
|
{
|
||||||
buf.append('#');
|
buf.append('#');
|
||||||
buf.append(uri.getFragment());
|
buf.append(fragment);
|
||||||
}
|
}
|
||||||
location=buf.toString();
|
location=buf.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -423,8 +423,13 @@ public class ResponseTest
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
String[][] tests={
|
String[][] tests={
|
||||||
{"/other/location?name=value","http://myhost:8888/other/location;jsessionid=12345?name=value"},
|
// No cookie
|
||||||
/* {"/other/location","http://myhost:8888/other/location"},
|
{"http://myhost:8888/other/location;jsessionid=12345?name=value","http://myhost:8888/other/location;jsessionid=12345?name=value"},
|
||||||
|
{"/other/location;jsessionid=12345?name=value","http://myhost:8888/other/location;jsessionid=12345?name=value"},
|
||||||
|
{"./location;jsessionid=12345?name=value","http://myhost:8888/path/location;jsessionid=12345?name=value"},
|
||||||
|
|
||||||
|
// From cookie
|
||||||
|
{"/other/location","http://myhost:8888/other/location"},
|
||||||
{"/other/l%20cation","http://myhost:8888/other/l%20cation"},
|
{"/other/l%20cation","http://myhost:8888/other/l%20cation"},
|
||||||
{"location","http://myhost:8888/path/location"},
|
{"location","http://myhost:8888/path/location"},
|
||||||
{"./location","http://myhost:8888/path/location"},
|
{"./location","http://myhost:8888/path/location"},
|
||||||
|
@ -432,11 +437,11 @@ public class ResponseTest
|
||||||
{"/other/l%20cation","http://myhost:8888/other/l%20cation"},
|
{"/other/l%20cation","http://myhost:8888/other/l%20cation"},
|
||||||
{"l%20cation","http://myhost:8888/path/l%20cation"},
|
{"l%20cation","http://myhost:8888/path/l%20cation"},
|
||||||
{"./l%20cation","http://myhost:8888/path/l%20cation"},
|
{"./l%20cation","http://myhost:8888/path/l%20cation"},
|
||||||
{"../l%20cation","http://myhost:8888/l%20cation"},*/
|
{"../l%20cation","http://myhost:8888/l%20cation"},
|
||||||
{"../locati%C3%abn","http://myhost:8888/locati%C3%ABn"},
|
{"../locati%C3%abn","http://myhost:8888/locati%C3%ABn"},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i=1;i<tests.length;i++)
|
for (int i=0;i<tests.length;i++)
|
||||||
{
|
{
|
||||||
ByteArrayEndPoint out=new ByteArrayEndPoint(new byte[]{},4096);
|
ByteArrayEndPoint out=new ByteArrayEndPoint(new byte[]{},4096);
|
||||||
AbstractHttpConnection connection=new TestHttpConnection(connector,out, connector.getServer());
|
AbstractHttpConnection connection=new TestHttpConnection(connector,out, connector.getServer());
|
||||||
|
@ -447,7 +452,7 @@ public class ResponseTest
|
||||||
request.setUri(new HttpURI("/path/info;param;jsessionid=12345?query=0&more=1#target"));
|
request.setUri(new HttpURI("/path/info;param;jsessionid=12345?query=0&more=1#target"));
|
||||||
request.setContextPath("/path");
|
request.setContextPath("/path");
|
||||||
request.setRequestedSessionId("12345");
|
request.setRequestedSessionId("12345");
|
||||||
request.setRequestedSessionIdFromCookie(i>0);
|
request.setRequestedSessionIdFromCookie(i>2);
|
||||||
AbstractSessionManager manager=new HashSessionManager();
|
AbstractSessionManager manager=new HashSessionManager();
|
||||||
manager.setSessionIdManager(new HashSessionIdManager());
|
manager.setSessionIdManager(new HashSessionIdManager());
|
||||||
request.setSessionManager(manager);
|
request.setSessionManager(manager);
|
||||||
|
@ -460,7 +465,7 @@ public class ResponseTest
|
||||||
int l=location.indexOf("Location: ");
|
int l=location.indexOf("Location: ");
|
||||||
int e=location.indexOf('\n',l);
|
int e=location.indexOf('\n',l);
|
||||||
location=location.substring(l+10,e).trim();
|
location=location.substring(l+10,e).trim();
|
||||||
assertEquals(tests[i][0],tests[i][1],location);
|
assertEquals("test-"+i,tests[i][1],location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue