summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-06-01 00:59:26 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-06-01 00:59:26 +0000
commit5731599ef0128fca97444ee34dd2ca71edcaf16a (patch)
tree68d565fd579cd74a10341733d67b9893c19e39b9 /src/couchdb
parentc46bbe3d924e9e56b6f4ade94e0e27eec9e5a37c (diff)
better tests for the vhost globals, fixed a bug
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@949912 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_httpd.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 0e5cedf8..6c08847c 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -311,8 +311,14 @@ increment_method_stats(Method) ->
% 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 keep available on vhosts. You can also use it to make databases 'global'.
vhost_global(VhostGlobals, MochiReq) ->
- "/"++Path = MochiReq:get(path),
- [true] == [true||V <- VhostGlobals, V == Path].
+ "/" ++ Path = MochiReq:get(path),
+ Front = case partition(Path) of
+ {"", "", ""} ->
+ "/"; % Special case the root url handler
+ {FirstPart, _, _} ->
+ FirstPart
+ end,
+ [true] == [true||V <- VhostGlobals, V == Front].
% Utilities