From 289ea07f61b2db9e6b3971301cc8e722b69de735 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Mon, 20 Jun 2011 07:48:15 +0000 Subject: [PATCH] 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://. --- url.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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++; -- 2.47.2