aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-09-22 00:17:41 +0000
committerRoger Dingledine <arma@torproject.org>2005-09-22 00:17:41 +0000
commit959598fae626545e54db9c6af0b4993341279acc (patch)
tree2603778332caf712eef139af07a0422cb9bca3ec /src
parentf011b12df2f9f681404e919d0707e8adadc0043f (diff)
downloadtor-959598fae626545e54db9c6af0b4993341279acc.tar.gz
tor-959598fae626545e54db9c6af0b4993341279acc.zip
content-type bugfixes:
http://seppia.noreply.org/tor/dir.z was being declared text/plain and http://seppia.noreply.org/tor/server/fp/719BE45DE224B607C53707D0E2143E2D423E74CF was being declared application/octet-stream svn:r5108
Diffstat (limited to 'src')
-rw-r--r--src/or/directory.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 946557ab9f..771a776a6d 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1201,9 +1201,10 @@ directory_handle_command_get(connection_t *conn, char *headers,
log_fn(LOG_DEBUG,"Dumping %sdirectory to client.",
deflated?"deflated ":"");
format_rfc1123_time(date, time(NULL));
- tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: text/plain\r\nContent-Encoding: %s\r\n\r\n",
+ tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
date,
(int)dlen,
+ deflated?"application/octet-stream":"text/plain",
deflated?"deflate":"identity");
connection_write_to_buf(tmp, strlen(tmp), conn);
connection_write_to_buf(cp, dlen, conn);
@@ -1224,9 +1225,10 @@ directory_handle_command_get(connection_t *conn, char *headers,
}
format_rfc1123_time(date, time(NULL));
- tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: text/plain\r\nContent-Encoding: %s\r\n\r\n",
+ tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
date,
(int)dlen,
+ deflated?"application/octet-stream":"text/plain",
deflated?"deflate":"identity");
connection_write_to_buf(tmp, strlen(tmp), conn);
connection_write_to_buf(cp, strlen(cp), conn);
@@ -1255,9 +1257,10 @@ directory_handle_command_get(connection_t *conn, char *headers,
SMARTLIST_FOREACH(dir_objs, cached_dir_t *, d,
dlen += deflated?d->dir_z_len:d->dir_len);
format_rfc1123_time(date, time(NULL));
- tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: text/plain\r\nContent-Encoding: %s\r\n\r\n",
+ tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
date,
(int)dlen,
+ deflated?"application/octet-stream":"text/plain",
deflated?"deflate":"identity");
connection_write_to_buf(tmp, strlen(tmp), conn);
SMARTLIST_FOREACH(dir_objs, cached_dir_t *, d,
@@ -1315,7 +1318,7 @@ directory_handle_command_get(connection_t *conn, char *headers,
connection_write_to_buf(compressed, compressed_len, conn);
tor_free(compressed);
} else {
- tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: application/octet-stream\r\n\r\n",
+ tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: text/plain\r\n\r\n",
date,
(int)len);
connection_write_to_buf(tmp, strlen(tmp), conn);