You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2012/12/04 21:43:51 UTC
[41/44] git commit: s/allows_credentials/credentials
s/allows_credentials/credentials
for consistency just use credentials. spotted by @tigolvi
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/915c811a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/915c811a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/915c811a
Branch: refs/heads/1368-fix-multipart-header-parts
Commit: 915c811a0833b1605f44ca40bb710de42bac9f99
Parents: a616f5c
Author: benoitc <bc...@gmail.com>
Authored: Thu Nov 1 21:50:54 2012 +0100
Committer: benoitc <bc...@gmail.com>
Committed: Thu Nov 1 21:57:48 2012 +0100
----------------------------------------------------------------------
etc/couchdb/default.ini.tpl.in | 4 ++--
src/couchdb/couch_httpd_cors.erl | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/915c811a/etc/couchdb/default.ini.tpl.in
----------------------------------------------------------------------
diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in
index 3960ab6..01ae4d9 100644
--- a/etc/couchdb/default.ini.tpl.in
+++ b/etc/couchdb/default.ini.tpl.in
@@ -69,7 +69,7 @@ allow_persistent_cookies = false ; set to true to allow persistent cookies
iterations = 10000 ; iterations for password hashing
[cors]
-allows_credentials = false
+credentials = false
; List of origins separated by a comma
;origins =
; List of accepted headers separated by a comma
@@ -80,7 +80,7 @@ allows_credentials = false
; Configuration for a vhost
;[cors:example.com]
-; allows_credentials = false
+; credentials = false
; List of origins separated by a comma
;origins =
; List of accepted headers separated by a comma
http://git-wip-us.apache.org/repos/asf/couchdb/blob/915c811a/src/couchdb/couch_httpd_cors.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_cors.erl b/src/couchdb/couch_httpd_cors.erl
index 69f57ed..4f8bf48 100644
--- a/src/couchdb/couch_httpd_cors.erl
+++ b/src/couchdb/couch_httpd_cors.erl
@@ -71,7 +71,7 @@ cors_headers(#httpd{mochi_req=MochiReq}) ->
handle_cors_headers("*", _Host, _AcceptedOrigins) ->
[{"Access-Control-Allow-Origin", "*"}];
handle_cors_headers(Origin, Host, []) ->
- case allows_credentials(Origin, Host) of
+ case credentials(Origin, Host) of
true ->
[{"Access-Control-Allow-Origin", Origin},
{"Access-Control-Allow-Credentials", "true"}];
@@ -79,9 +79,9 @@ handle_cors_headers(Origin, Host, []) ->
[{"Access-Control-Allow-Origin", Origin}]
end;
handle_cors_headers(Origin, Host, AcceptedOrigins) ->
- AllowsCredentials = allows_credentials(Origin, Host),
+ AllowCredentials = credentials(Origin, Host),
case lists:member(Origin, AcceptedOrigins) of
- true when AllowsCredentials =:= true ->
+ true when AllowCredentials =:= true ->
[{"Access-Control-Allow-Origin", Origin},
{"Access-Control-Allow-Credentials", "true"}];
true ->
@@ -133,7 +133,7 @@ handle_preflight_request(Origin, Host, MochiReq) ->
% get max age
MaxAge = cors_config(Host, "max_age", "12345"),
- PreflightHeaders0 = case allows_credentials(Origin, Host) of
+ PreflightHeaders0 = case credentials(Origin, Host) of
true ->
[{"Access-Control-Allow-Origin", Origin},
{"Access-Control-Allow-Credentials", "true"},
@@ -183,13 +183,13 @@ handle_preflight_request(Origin, Host, MochiReq) ->
end.
-allows_credentials("*", _Host) ->
+credentials("*", _Host) ->
false;
-allows_credentials(_Origin, Host) ->
- Default = get_bool_config("cors", "allows_credentials",
+credentials(_Origin, Host) ->
+ Default = get_bool_config("cors", "credentials",
false),
- get_bool_config(cors_section(Host), "allows_credentials",
+ get_bool_config(cors_section(Host), "credentials",
Default).