couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [10/11] chttpd commit: updated refs/heads/master to 238b8c4
Date Wed, 12 Aug 2015 15:54:34 GMT
Use `#httpd.cors_config`


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/2b427592
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/2b427592
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/2b427592

Branch: refs/heads/master
Commit: 2b427592d811db38723905127157a06bb3a19a9d
Parents: 9118f8d
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Mon Jun 29 06:19:11 2015 -0700
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Aug 11 09:14:29 2015 -0700

----------------------------------------------------------------------
 src/chttpd_cors.erl | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/2b427592/src/chttpd_cors.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_cors.erl b/src/chttpd_cors.erl
index cedb86e..fc30c9a 100644
--- a/src/chttpd_cors.erl
+++ b/src/chttpd_cors.erl
@@ -265,7 +265,7 @@ allow_credentials(Config, Origin) ->
     get_origin_config(Config, Origin, <<"allow_credentials">>,
         ?CORS_DEFAULT_ALLOW_CREDENTIALS).
 
-get_cors_config(_Req) ->
+get_cors_config(#httpd{cors_config = undefined}) ->
     EnableCors = config:get("httpd", "enable_cors", "false") =:= "true",
     AllowCredentials = config:get("cors", "credentials", "false") =:= "true",
     AllowHeaders = case config:get("cors", "methods", undefined) of
@@ -288,8 +288,9 @@ get_cors_config(_Req) ->
         {<<"allow_methods">>, AllowMethods},
         {<<"allow_headers">>, AllowHeaders},
         {<<"origins">>, {Origins}}
-    ].
-
+    ];
+get_cors_config(#httpd{cors_config = Config}) ->
+    Config.
 
 is_cors_enabled(Config) ->
     case get(disable_couch_httpd_cors) of


Mime
View raw message