summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2012-12-05 19:19:19 +0100
committerJan Lehnardt <jan@apache.org>2012-12-05 23:02:03 +0100
commit8e888858fb6c6de626961685f6c7b253c60e2edb (patch)
treedbcab4c122b52e1fc737793e4d0bf6c142b2e131
parentb90e40212663474e873fde6cab343c31c1e635e7 (diff)
downloadcouchdb-8e888858fb6c6de626961685f6c7b253c60e2edb.tar.gz
fix whitespace
-rw-r--r--etc/couchdb/default.ini.tpl.in2
-rw-r--r--src/couchdb/Makefile.am2
-rw-r--r--src/couchdb/couch_httpd.erl10
-rw-r--r--src/couchdb/couch_httpd_vhost.erl30
4 files changed, 22 insertions, 22 deletions
diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in
index 25621238d..be92fcf34 100644
--- a/etc/couchdb/default.ini.tpl.in
+++ b/etc/couchdb/default.ini.tpl.in
@@ -249,7 +249,7 @@ socket_options = [{keepalive, true}, {nodelay, false}]
;cert_file = /full/path/to/server_cert.pem
; Path to file containing user's private PEM encoded key.
;key_file = /full/path/to/server_key.pem
-; String containing the user's password. Only used if the private keyfile is password protected.
+; String containing the user's password. Only used if the private keyfile is password protected.
;password = somepassword
; Set to true to validate peer certificates.
verify_ssl_certificates = false
diff --git a/src/couchdb/Makefile.am b/src/couchdb/Makefile.am
index 2b067b412..9fe19bcd3 100644
--- a/src/couchdb/Makefile.am
+++ b/src/couchdb/Makefile.am
@@ -80,7 +80,7 @@ source_files = \
couch_work_queue.erl \
json_stream_parse.erl
-EXTRA_DIST = $(source_files) couch_db.hrl couch_js_functions.hrl
+EXTRA_DIST = $(source_files) couch_db.hrl couch_js_functions.hrl
compiled_files = \
couch.app \
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 64d1cf114..9ded36d6d 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -324,11 +324,11 @@ handle_request_int(MochiReq, DefaultFun,
try
case couch_httpd_cors:is_preflight_request(HttpReq) of
#httpd{} ->
- case authenticate_request(HttpReq, AuthHandlers) of
- #httpd{} = Req ->
- HandlerFun(Req);
- Response ->
- Response
+ case authenticate_request(HttpReq, AuthHandlers) of
+ #httpd{} = Req ->
+ HandlerFun(Req);
+ Response ->
+ Response
end;
Response ->
Response
diff --git a/src/couchdb/couch_httpd_vhost.erl b/src/couchdb/couch_httpd_vhost.erl
index 96804cb5b..4c3ebfebe 100644
--- a/src/couchdb/couch_httpd_vhost.erl
+++ b/src/couchdb/couch_httpd_vhost.erl
@@ -32,7 +32,7 @@
%% doc the vhost manager.
%% This gen_server keep state of vhosts added to the ini and try to
%% match the Host header (or forwarded) against rules built against
-%% vhost list.
+%% vhost list.
%%
%% Declaration of vhosts take place in the configuration file :
%%
@@ -51,7 +51,7 @@
%% "*.db.example.com = /" will match all cname on top of db
%% examples to the root of the machine.
%%
-%%
+%%
%% Rewriting Hosts to path
%% -----------------------
%%
@@ -75,7 +75,7 @@
%% redirect_vhost_handler = {Module, Fun}
%%
%% The function take 2 args : the mochiweb request object and the target
-%%% path.
+%%% path.
start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
@@ -125,14 +125,14 @@ append_path("/"=_Target, "/"=_Path) ->
append_path(Target, Path) ->
Target ++ Path.
-% default redirect vhost handler
+% default redirect vhost handler
redirect_to_vhost(MochiReq, VhostTarget) ->
Path = MochiReq:get(raw_path),
Target = append_path(VhostTarget, Path),
?LOG_DEBUG("Vhost Target: '~p'~n", [Target]),
- Headers = mochiweb_headers:enter("x-couchdb-vhost-path", Path,
+ Headers = mochiweb_headers:enter("x-couchdb-vhost-path", Path,
MochiReq:get(headers)),
% build a new mochiweb request
@@ -146,7 +146,7 @@ redirect_to_vhost(MochiReq, VhostTarget) ->
MochiReq1.
%% if so, then it will not be rewritten, but will run as a normal couchdb request.
-%* normally you'd use this for _uuids _utils and a few of the others you want to
+%* normally you'd use this for _uuids _utils and a few of the others you want to
%% keep available on vhosts. You can also use it to make databases 'global'.
vhost_global( VhostGlobals, MochiReq) ->
RawUri = MochiReq:get(raw_path),
@@ -167,14 +167,14 @@ try_bind_vhost([], _HostParts, _Port, _PathParts) ->
try_bind_vhost([VhostSpec|Rest], HostParts, Port, PathParts) ->
{{VHostParts, VPort, VPath}, Path} = VhostSpec,
case bind_port(VPort, Port) of
- ok ->
+ ok ->
case bind_vhost(lists:reverse(VHostParts), HostParts, []) of
{ok, Bindings, Remainings} ->
case bind_path(VPath, PathParts) of
{ok, PathParts1} ->
Path1 = make_target(Path, Bindings, Remainings, []),
{make_path(Path1), make_path(PathParts1)};
- fail ->
+ fail ->
try_bind_vhost(Rest, HostParts, Port,
PathParts)
end;
@@ -185,7 +185,7 @@ try_bind_vhost([VhostSpec|Rest], HostParts, Port, PathParts) ->
%% doc: build new patch from bindings. bindings are query args
%% (+ dynamic query rewritten if needed) and bindings found in
-%% bind_path step.
+%% bind_path step.
%% TODO: merge code with rewrite. But we need to make sure we are
%% in string here.
make_target([], _Bindings, _Remaining, Acc) ->
@@ -215,7 +215,7 @@ bind_vhost([],[], Bindings) -> {ok, Bindings, []};
bind_vhost([?MATCH_ALL], [], _Bindings) -> fail;
bind_vhost([?MATCH_ALL], Rest, Bindings) -> {ok, Bindings, Rest};
bind_vhost([], _HostParts, _Bindings) -> fail;
-bind_vhost([{bind, Token}|Rest], [Match|RestHost], Bindings) ->
+bind_vhost([{bind, Token}|Rest], [Match|RestHost], Bindings) ->
bind_vhost(Rest, RestHost, [{{bind, Token}, Match}|Bindings]);
bind_vhost([Cname|Rest], [Cname|RestHost], Bindings) ->
bind_vhost(Rest, RestHost, Bindings);
@@ -272,15 +272,15 @@ parse_vhost(Vhost) ->
H1 = make_spec(H, []),
{H1, P, string:tokens(Path, "/")}
end.
-
+
split_host_port(HostAsString) ->
case string:rchr(HostAsString, $:) of
0 ->
{split_host(HostAsString), '*'};
N ->
- HostPart = string:substr(HostAsString, 1, N-1),
- case (catch erlang:list_to_integer(string:substr(HostAsString,
+ HostPart = string:substr(HostAsString, 1, N-1),
+ case (catch erlang:list_to_integer(string:substr(HostAsString,
N+1, length(HostAsString)))) of
{'EXIT', _} ->
{split_host(HostAsString), '*'};
@@ -308,7 +308,7 @@ make_spec([P|R], Acc) ->
parse_var(P) ->
- case P of
+ case P of
":" ++ Var ->
{bind, Var};
_ -> P
@@ -328,7 +328,7 @@ make_path(Parts) ->
init(_) ->
ok = couch_config:register(fun ?MODULE:config_change/2),
-
+
%% load configuration
{VHostGlobals, VHosts, Fun} = load_conf(),
State = #vhosts_state{