From 9bf80e3788755a1f823802494233b4e06a3f8b87 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 14 Oct 2011 13:54:52 +0000 Subject: Improve bad URL handling. svn path=/trunk/netsurf/; revision=13045 --- utils/nsurl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/nsurl.c b/utils/nsurl.c index c184758c9..f2f6e3bfe 100644 --- a/utils/nsurl.c +++ b/utils/nsurl.c @@ -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 */ -- cgit v1.2.3