From: Frédéric Marchal Date: Mon, 20 Jun 2011 07:48:15 +0000 (+0000) Subject: Add underscore in scheme characters X-Git-Tag: v2.3.2~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=289ea07f61b2db9e6b3971301cc8e722b69de735;p=thirdparty%2Fsarg.git Add underscore in scheme characters The underscore is not a valid character in the scheme of a URL but it is used by squid as in cache_object://. --- diff --git a/url.c b/url.c index a4ee365..3c3d735 100644 --- 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++;