]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Add underscore in scheme characters
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 20 Jun 2011 07:48:15 +0000 (07:48 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 20 Jun 2011 07:48:15 +0000 (07:48 +0000)
The underscore is not a valid character in the scheme of a URL but it is used
by squid as in cache_object://.

url.c

diff --git a/url.c b/url.c
index a4ee3658715b1b08532b3fca5b3056c8b9c2d616..3c3d73515bf3400fe42063ad86be694e9f3e0727 100644 (file)
--- a/url.c
+++ b/url.c
@@ -275,8 +275,11 @@ const char *process_url(char *url,bool full_url)
        char *str;
        const char *start;
 
-       // remove any scheme:// at the beginning of the URL (see rfc2396 section 3.1)
-       for (str=url ; *str && (isalnum(*str) || *str=='+' || *str=='-' || *str=='.') ; str++);
+       /*
+       Remove any scheme:// at the beginning of the URL (see rfc2396 section 3.1).
+       The underscore is not part of the standard but is found in the squid logs as cache_object://.
+       */
+       for (str=url ; *str && (isalnum(*str) || *str=='+' || *str=='-' || *str=='.' || *str=='_') ; str++);
        if (*str==':' && str[1]=='/' && str[2]=='/') {
                url=str+3;
                while (*url=='/') url++;