482670 - HttpURI wrongly parser URI paths starting with /@
This commit is contained in:
parent
a2c057892e
commit
ee9c57e3ea
|
@ -301,10 +301,6 @@ public class HttpURI
|
|||
break;
|
||||
|
||||
case '@':
|
||||
_user=uri.substring(mark,i);
|
||||
mark=i+1;
|
||||
break;
|
||||
|
||||
case ';':
|
||||
case '?':
|
||||
case '#':
|
||||
|
|
|
@ -98,6 +98,13 @@ public class HttpURIParseTest
|
|||
|
||||
// Path with query alt syntax
|
||||
{"/path/info?a=;query",null,null,null,"/path/info",null,"a=;query",null},
|
||||
|
||||
// URI with host character
|
||||
{"/@path/info",null,null,null,"/@path/info",null,null,null},
|
||||
{"/user@path/info",null,null,null,"/user@path/info",null,null,null},
|
||||
{"//user@host/info",null,"host",null,"/info",null,null,null},
|
||||
{"//@host/info",null,"host",null,"/info",null,null,null},
|
||||
{"@host/info",null,null,null,"@host/info",null,null,null},
|
||||
|
||||
// Scheme-less, with host and port (overlapping with path)
|
||||
{"//host:8080//",null,"host","8080","//",null,null,null},
|
||||
|
|
|
@ -92,7 +92,13 @@ public class HttpURITest
|
|||
assertEquals(value,parameters.getString("value"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testAt() throws Exception
|
||||
{
|
||||
HttpURI uri = new HttpURI("/@foo/bar");
|
||||
assertEquals("/@foo/bar",uri.getPath());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParams() throws Exception
|
||||
|
|
Loading…
Reference in New Issue