From 37ca97c918f4b5316e4293d8f1001bb87b8dfb0c Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Tue, 9 Sep 2008 11:12:36 +0000 Subject: Fix for attachment content-type conversion from/to binary in RESTful API. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@693435 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index c745fdb8..bdc172a3 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -731,7 +731,7 @@ handle_attachment_request(Req, 'GET', _DbName, Db, DocId, FileName) -> {Type, Bin} -> Resp = Req:respond({200, [ {"Cache-Control", "must-revalidate"}, - {"Content-Type", Type}, + {"Content-Type", binary_to_list(Type)}, {"Content-Length", integer_to_list(couch_doc:bin_size(Bin))} ] ++ server_header(), chunked}), couch_doc:bin_foldl(Bin, @@ -756,7 +756,7 @@ handle_attachment_request(Req, Method, _DbName, Db, DocId, FileName) []; _ -> [{FileName, { - Req:get_header_value("Content-Type"), + list_to_binary(Req:get_header_value("Content-Type")), Req:recv_body() }}] end, -- cgit v1.2.3