]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make url-canonicalizer canonicalize correctly.
authorNick Mathewson <nickm@torproject.org>
Tue, 5 Sep 2017 19:02:16 +0000 (15:02 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 5 Sep 2017 19:02:16 +0000 (15:02 -0400)
src/or/directory.c

index 5bf544e67fc1cd7c11bd8189007bae75e0186e73..007235d108e6cfccceeb166846f3ef844b4d0e81 100644 (file)
@@ -1971,7 +1971,9 @@ parse_http_url(const char *headers, char **url)
   }
   if (strcmpstart(*url, "/tor/")) {
     char *new_url = NULL;
-    tor_asprintf(&new_url, "/tor/%s", *url);
+    tor_asprintf(&new_url, "/tor%s%s",
+                 *url[0] == '/' ? "" : "/",
+                 *url);
     tor_free(*url);
     *url = new_url;
   }