couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [2/2] chttpd commit: updated refs/heads/2328-bug-cors-show-update to 0e1af4d
Date Fri, 12 Sep 2014 18:58:30 GMT
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/0e1af4dd
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/0e1af4dd
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/0e1af4dd

Branch: refs/heads/2328-bug-cors-show-update
Commit: 0e1af4dde8c1432614517fc2d98517bc84f45ec1
Parents: 359503d
Author: Russell Branca <chewbranca@apache.org>
Authored: Wed Sep 10 15:20:40 2014 -0700
Committer: Russell Branca <chewbranca@apache.org>
Committed: Thu Sep 11 14:39:22 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/0e1af4dd/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}) ->


Mime
View raw message