Improve bad URL handling.

svn path=/trunk/netsurf/; revision=13045
This commit is contained in:
Michael Drake 2011-10-14 13:54:52 +00:00
parent 57e3c0748c
commit 9bf80e3788

View File

@ -286,6 +286,7 @@ static void nsurl__get_string_markers(const char const *url_s,
*/
if (*pos != '\0' &&
((joining == false && is_http == true && *pos != '/') ||
(joining == true && is_http == true && *pos == '/') ||
(*pos == '/' && *(pos + 1) == '/'))) {
/* Skip over leading slashes */
if (is_http == false) {
@ -1003,6 +1004,7 @@ void nsurl__test(void)
/* Extra tests */
{ " g", "http://a/b/c/g" },
{ " http:/b/c", "http://b/c" },
/* [1] Extra slash beyond rfc3986 5.4.1 example, since we're
* testing normalisation in addition to joining */
/* [2] Using the strict parsers option */