diff options
author | Jan Lehnardt <jan@apache.org> | 2011-07-04 14:35:13 +0000 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2011-07-04 14:35:13 +0000 |
commit | 5fa79a85bcb2eea059fd948e89433965f8160b1f (patch) | |
tree | e5ec590d131435ac72b10a783b09cc6d4e6b993b /src/couchdb | |
parent | 6ef446ab98848d1b2b42785a1826567627af8e7a (diff) |
Backport r1142685 from trunk: Allow "/" as vhost target.
Includes a one-line whitespace fix.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1142689 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r-- | src/couchdb/couch_httpd_vhost.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd_vhost.erl b/src/couchdb/couch_httpd_vhost.erl index 9bfb5951..a9517600 100644 --- a/src/couchdb/couch_httpd_vhost.erl +++ b/src/couchdb/couch_httpd_vhost.erl @@ -216,15 +216,19 @@ code_change(_OldVsn, State, _Extra) -> {ok, State}. +append_path("/"=_Target, "/"=_Path) -> + "/"; +append_path(Target, Path) -> + Target ++ Path. % default redirect vhost handler redirect_to_vhost(MochiReq, VhostTarget) -> Path = MochiReq:get(raw_path), - Target = VhostTarget ++ Path, + Target = append_path(VhostTarget, Path), ?LOG_DEBUG("Vhost Target: '~p'~n", [Target]), - + Headers = mochiweb_headers:enter("x-couchdb-vhost-path", Path, MochiReq:get(headers)), |