summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd.erl
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-09-09 11:12:36 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-09-09 11:12:36 +0000
commit37ca97c918f4b5316e4293d8f1001bb87b8dfb0c (patch)
treee26fda143521e2fa2935ba657d8f00f22c3e5d9a /src/couchdb/couch_httpd.erl
parentb8e510ba813f9b5a24483e16dd6a9971b31dc876 (diff)
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
Diffstat (limited to 'src/couchdb/couch_httpd.erl')
-rw-r--r--src/couchdb/couch_httpd.erl4
1 files changed, 2 insertions, 2 deletions
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,