]> granicus.if.org Git - apache/commitdiff
PR: 31875
authorNick Kew <niq@apache.org>
Mon, 25 Oct 2004 10:24:17 +0000 (10:24 +0000)
committerNick Kew <niq@apache.org>
Mon, 25 Oct 2004 10:24:17 +0000 (10:24 +0000)
Fix URI parsing bug in case of a leading double-slash

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105586 13f79535-47bb-0310-9956-ffa450edef68

server/protocol.c

index 05ce5ff9c10ac0bc334df572171229fb28c69f0a..cdb773b838169c3a84a860015d297d03f762aad0 100644 (file)
@@ -502,6 +502,16 @@ AP_CORE_DECLARE(void) ap_parse_uri(request_rec *r, const char *uri)
 
     r->unparsed_uri = apr_pstrdup(r->pool, uri);
 
+    /* http://issues.apache.org/bugzilla/show_bug.cgi?id=31875
+     * http://issues.apache.org/bugzilla/show_bug.cgi?id=28450
+     *
+     * This is not in fact a URI, it's a path.  That matters in the
+     * case of a leading double-slash.  We need to resolve the issue
+     * by normalising that out before treating it as a URI.
+     */
+    while ((uri[0] == '/') && (uri[1] == '/')) {
+        ++uri ;
+    }
     if (r->method_number == M_CONNECT) {
         status = apr_uri_parse_hostinfo(r->pool, uri, &r->parsed_uri);
     }