diff options
author | Alexander Færøy <ahf@torproject.org> | 2017-05-22 12:34:57 +0000 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2017-05-22 12:36:27 +0000 |
commit | 26795da900d7b487b80e19b804475ad7b132188d (patch) | |
tree | 9c934a54f7cc70a32614c08671e610287235b328 | |
parent | 0698a0beca8387e2d365fd0cd5801ecc4f910de3 (diff) | |
download | tor-26795da900d7b487b80e19b804475ad7b132188d.tar.gz tor-26795da900d7b487b80e19b804475ad7b132188d.zip |
Don't add "Accept-Encoding" header if directory connection is anonymous.
See: https://bugs.torproject.org/22305
-rw-r--r-- | src/or/directory.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index ef74c0fed4..5aab8a7328 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1677,6 +1677,7 @@ directory_send_command(dir_connection_t *conn, const char *payload = req->payload; const size_t payload_len = req->payload_len; const time_t if_modified_since = req->if_modified_since; + const int anonymized_connection = dirind_is_anon(req->indirection); char proxystring[256]; char hoststring[128]; @@ -1742,11 +1743,13 @@ directory_send_command(dir_connection_t *conn, proxystring[0] = 0; } - /* Add Accept-Encoding. */ - accept_encoding = accept_encoding_header(); - smartlist_add_asprintf(headers, "Accept-Encoding: %s\r\n", - accept_encoding); - tor_free(accept_encoding); + if (! anonymized_connection) { + /* Add Accept-Encoding. */ + accept_encoding = accept_encoding_header(); + smartlist_add_asprintf(headers, "Accept-Encoding: %s\r\n", + accept_encoding); + tor_free(accept_encoding); + } /* Add additional headers, if any */ { |