Make parsing wxURI paths more conforming to RFC 3986
Don't recognize the "path" following the port number without a slash as a path, this is invalid according to the RFC. Also require two leading slashes for URIs without the authority part.
This commit is contained in:
parent
466a2d000f
commit
b7f3a2b30f
2 changed files with 22 additions and 0 deletions
|
|
@ -189,6 +189,13 @@ void URITestCase::Paths()
|
|||
|
||||
URI_ASSERT_PART_EQUAL("path/john/../../../joe",
|
||||
"../joe", BuildURI());
|
||||
|
||||
// According to RFC 3986, when the authority is present, the path must
|
||||
// begin with a slash (or be empty) and when there is no authority, the
|
||||
// path cannot begin with two slashes, so check for this.
|
||||
URI_ASSERT_PATH_EQUAL("http://good.com:8042BADPATH", "");
|
||||
URI_ASSERT_PATH_EQUAL("http://good.com:8042/GOODPATH", "/GOODPATH");
|
||||
URI_ASSERT_PATH_EQUAL("//BADPATH", "");
|
||||
}
|
||||
|
||||
void URITestCase::UserAndPass()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue