Browse Source

Make url-canonicalizer canonicalize correctly.

Nick Mathewson 6 years ago
parent
commit
342712b9ef
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/or/directory.c

+ 3 - 1
src/or/directory.c

@@ -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;
   }