summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2008-10-09 22:02:05 +0000
committerJohn Christopher Anderson <jchris@apache.org>2008-10-09 22:02:05 +0000
commit929607cf0512010f45c9fbf8f38ef844996845f8 (patch)
tree5907995535867e36f5ff02f9ab943695345add7f /src/couchdb
parent20cfb68472d20eafb8d1b2d18f12894f858d240a (diff)
remove content-length header from file attachment responses. see inline comments
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@703275 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-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),