summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/couchdb/couch_httpd_db.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 240b2730..a60686fd 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -504,8 +504,13 @@ db_attachment_req(#httpd{method='GET'}=Req, Db, DocId, FileName) ->
{Type, Bin} ->
{ok, Resp} = start_chunked_response(Req, 200, [
{"Cache-Control", "must-revalidate"},
- {"Content-Type", binary_to_list(Type)},
- {"Content-Length", integer_to_list(couch_doc:bin_size(Bin))}]),
+ {"Content-Type", binary_to_list(Type)}%,
+ % My understanding of http://www.faqs.org/rfcs/rfc2616.html
+ % says that we should not use Content-Length with a chunked
+ % encoding. Turning this off makes libcurl happy, but I am
+ % open to discussion.
+ % {"Content-Length", integer_to_list(couch_doc:bin_size(Bin))}
+ ]),
couch_doc:bin_foldl(Bin,
fun(BinSegment, []) ->
send_chunk(Resp, BinSegment),