diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-02-08 20:29:51 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-02-08 20:29:51 +0000 |
commit | 58e040359fa8d175b9eecec49f58e3dd00c78d1e (patch) | |
tree | 7c218754dd33d91c570473fdb0355c8e43341072 /src/couchdb/couch_httpd_db.erl | |
parent | 85471cdf0cf6ec23529b07ec4382948a5e76af3f (diff) |
extract method couch_httpd:send_redirect(Req, Path)
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@742158 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_db.erl')
-rw-r--r-- | src/couchdb/couch_httpd_db.erl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index 7d744d91..ae925123 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -263,9 +263,8 @@ db_req(#httpd{method='GET',mochi_req=MochiReq, path_parts=[DbName,<<"_design/",_ PathFront = "/" ++ couch_httpd:quote(binary_to_list(DbName)) ++ "/", RawSplit = regexp:split(MochiReq:get(raw_path),"_design%2F"), {ok, [PathFront|PathTail]} = RawSplit, - RedirectTo = couch_httpd:absolute_uri(Req, PathFront ++ "_design/" ++ - mochiweb_util:join(PathTail, "%2F")), - couch_httpd:send_response(Req, 301, [{"Location", RedirectTo}], <<>>); + couch_httpd:send_redirect(Req, PathFront ++ "_design/" ++ + mochiweb_util:join(PathTail, "_design%2F")); db_req(#httpd{path_parts=[_DbName,<<"_design">>,Name]}=Req, Db) -> db_doc_req(Req, Db, <<"_design/",Name/binary>>); |