diff options
Diffstat (limited to 'src/couchdb/couch_httpd_misc_handlers.erl')
-rw-r--r-- | src/couchdb/couch_httpd_misc_handlers.erl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl index 96a05c6d6..cd7b4287c 100644 --- a/src/couchdb/couch_httpd_misc_handlers.erl +++ b/src/couchdb/couch_httpd_misc_handlers.erl @@ -66,6 +66,9 @@ handle_file_req(Req, _) -> handle_utils_dir_req(#httpd{method='GET'}=Req, DocumentRoot) -> "/" ++ UrlPath = couch_httpd:path(Req), case couch_httpd:partition(UrlPath) of + {_ActionKey, "/", "fauxton"} -> + % GET /_utils/fauxton + handle_urls_without_slash(Req); {_ActionKey, "/", RelativePath} -> % GET /_utils/path or GET /_utils/ CachingHeaders = @@ -73,8 +76,7 @@ handle_utils_dir_req(#httpd{method='GET'}=Req, DocumentRoot) -> couch_httpd:serve_file(Req, RelativePath, DocumentRoot, CachingHeaders); {_ActionKey, "", _RelativePath} -> % GET /_utils - RedirectPath = couch_httpd:path(Req) ++ "/", - couch_httpd:send_redirect(Req, RedirectPath) + handle_urls_without_slash(Req) end; handle_utils_dir_req(Req, _) -> send_method_not_allowed(Req, "GET,HEAD"). @@ -86,6 +88,11 @@ handle_all_dbs_req(Req) -> send_method_not_allowed(Req, "GET,HEAD"). +handle_urls_without_slash(Req) -> + RedirectPath = couch_httpd:path(Req) ++ "/", + couch_httpd:send_redirect(Req, RedirectPath). + + handle_task_status_req(#httpd{method='GET'}=Req) -> ok = couch_httpd:verify_is_server_admin(Req), % convert the list of prop lists to a list of json objects |