summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-05 15:02:16 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-05 15:02:16 -0400
commit342712b9ef12c0234def9c2b4eb5c63f54c8bb5b (patch)
tree9e2c11ccea90bef1fdafa0232249a69457b4543e /src/or/directory.c
parent4e02d02076f4ffe51a2da8415d93ec983208a7c7 (diff)
downloadtor-342712b9ef12c0234def9c2b4eb5c63f54c8bb5b.tar.gz
tor-342712b9ef12c0234def9c2b4eb5c63f54c8bb5b.zip
Make url-canonicalizer canonicalize correctly.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 5bf544e67f..007235d108 100644
--- a/src/or/directory.c
+++ b/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;
}