diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-02 13:19:24 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-02 13:19:24 -0400 |
commit | 865514e66ef6c99a53ae92b089d24a187513532d (patch) | |
tree | de21b3bab053ee7a3fe16ac03576b41303bb1a19 /src/feature/dircache | |
parent | f0bd6c2c9dbce3bff9ceea57f8d26e9807d7150d (diff) | |
parent | 1b75de85b3cbc7706078a9899e483d18579a6fd1 (diff) | |
download | tor-865514e66ef6c99a53ae92b089d24a187513532d.tar.gz tor-865514e66ef6c99a53ae92b089d24a187513532d.zip |
Merge branch 'ticket28100_squashed'
Diffstat (limited to 'src/feature/dircache')
-rw-r--r-- | src/feature/dircache/dircache.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/feature/dircache/dircache.c b/src/feature/dircache/dircache.c index 872a88018f..dff4b85caa 100644 --- a/src/feature/dircache/dircache.c +++ b/src/feature/dircache/dircache.c @@ -166,22 +166,16 @@ write_http_response_header_impl(dir_connection_t *conn, ssize_t length, buf_free(buf); } -/** As write_http_response_header_impl, but sets encoding and content-typed - * based on whether the response will be <b>compressed</b> or not. */ +/** As write_http_response_header_impl, but translates method into + * encoding */ static void write_http_response_headers(dir_connection_t *conn, ssize_t length, compress_method_t method, const char *extra_headers, long cache_lifetime) { - const char *methodname = compression_method_get_name(method); - const char *doctype; - if (method == NO_METHOD) - doctype = "text/plain"; - else - doctype = "application/octet-stream"; write_http_response_header_impl(conn, length, - doctype, - methodname, + "text/plain", + compression_method_get_name(method), extra_headers, cache_lifetime); } |