From 929607cf0512010f45c9fbf8f38ef844996845f8 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Thu, 9 Oct 2008 22:02:05 +0000 Subject: 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 --- src/couchdb/couch_httpd_db.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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), -- cgit v1.2.3