Make url-canonicalizer canonicalize correctly.

This commit is contained in:
Nick Mathewson 2017-09-05 15:02:16 -04:00
parent 4e02d02076
commit 342712b9ef

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