From 0a46c330072a3811d98a5c989d4c6486cff83df2 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Fri, 23 Jan 2009 00:53:05 +0000 Subject: View list functions can stream views in any format. See list_views test for details. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@736876 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd_external.erl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/couchdb/couch_httpd_external.erl') diff --git a/src/couchdb/couch_httpd_external.erl b/src/couchdb/couch_httpd_external.erl index 7a682ddd..692044ba 100644 --- a/src/couchdb/couch_httpd_external.erl +++ b/src/couchdb/couch_httpd_external.erl @@ -14,18 +14,12 @@ -export([handle_external_req/2, handle_external_req/3]). -export([send_external_response/2, json_req_obj/2]). +-export([default_or_content_type/2, parse_external_response/1]). -import(couch_httpd,[send_error/4]). -include("couch_db.hrl"). --record(extern_resp_args, { - code = 200, - data = <<>>, - ctype = "application/json", - headers = [] -}). - % handle_external_req/2 % for the old type of config usage: % _external = {couch_httpd_external, handle_external_req} @@ -121,7 +115,10 @@ parse_external_response({Response}) -> {<<"body">>, Value} -> Args#extern_resp_args{data=Value, ctype="text/html"}; {<<"base64">>, Value} -> - Args#extern_resp_args{data=couch_util:decodeBase64(Value), ctype="application/binary"}; + Args#extern_resp_args{ + data=couch_util:decodeBase64(Value), + ctype="application/binary" + }; {<<"headers">>, {Headers}} -> NewHeaders = lists:map(fun({Header, HVal}) -> {binary_to_list(Header), binary_to_list(HVal)} -- cgit v1.2.3