You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2014/09/16 18:51:31 UTC
[1/2] chttpd commit: updated refs/heads/master to 61f432b
Repository: couchdb-chttpd
Updated Branches:
refs/heads/master b4e1c22b5 -> 61f432bb4
Make parse_external_response work with binaries and lists
COUCHDB-2328
Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/c3100e4b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/c3100e4b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/c3100e4b
Branch: refs/heads/master
Commit: c3100e4bc8d01e9e39c3c09485fa9ffc29e3bea8
Parents: b4e1c22
Author: Russell Branca <ch...@apache.org>
Authored: Wed Sep 10 15:18:57 2014 -0700
Committer: Russell Branca <ch...@apache.org>
Committed: Tue Sep 16 09:51:11 2014 -0700
----------------------------------------------------------------------
src/chttpd_external.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/c3100e4b/src/chttpd_external.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_external.erl b/src/chttpd_external.erl
index d86e13f..d77690d 100644
--- a/src/chttpd_external.erl
+++ b/src/chttpd_external.erl
@@ -153,7 +153,7 @@ parse_external_response({Response}) ->
};
{<<"headers">>, {Headers}} ->
NewHeaders = lists:map(fun({Header, HVal}) ->
- {binary_to_list(Header), binary_to_list(HVal)}
+ {couch_util:to_list(Header), couch_util:to_list(HVal)}
end, Headers),
Args#extern_resp_args{headers=NewHeaders};
_ -> % unknown key
[2/2] chttpd commit: updated refs/heads/master to 61f432b
Posted by ch...@apache.org.
Add CORS headers to chttpd_external:send_external_response
COUCHDB-2328
Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/61f432bb
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/61f432bb
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/61f432bb
Branch: refs/heads/master
Commit: 61f432bb4b52a9055ac86c8a18644711b2d742a9
Parents: c3100e4
Author: Russell Branca <ch...@apache.org>
Authored: Wed Sep 10 15:20:40 2014 -0700
Committer: Russell Branca <ch...@apache.org>
Committed: Tue Sep 16 09:51:20 2014 -0700
----------------------------------------------------------------------
src/chttpd_external.erl | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/61f432bb/src/chttpd_external.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_external.erl b/src/chttpd_external.erl
index d77690d..38932d1 100644
--- a/src/chttpd_external.erl
+++ b/src/chttpd_external.erl
@@ -124,11 +124,12 @@ send_external_response(Req, Response) ->
json = Json
} = parse_external_response(Response),
Headers1 = default_or_content_type(CType, Headers),
+ Headers2 = chttpd_cors:headers(Req, Headers1),
case Json of
nil ->
- chttpd:send_response(Req, Code, Headers1, Data);
+ chttpd:send_response(Req, Code, Headers2, Data);
Json ->
- chttpd:send_json(Req, Code, Headers1, Json)
+ chttpd:send_json(Req, Code, Headers2, Json)
end.
parse_external_response({Response}) ->