summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_db.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb/couch_httpd_db.erl')
-rw-r--r--src/couchdb/couch_httpd_db.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 915a5eae..a3ac69ae 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -496,8 +496,8 @@ db_req(#httpd{path_parts=[_,<<"_revs_limit">>]}=Req, _Db) ->
% as slashes in document IDs must otherwise be URL encoded.
db_req(#httpd{method='GET',mochi_req=MochiReq, path_parts=[DbName,<<"_design/",_/binary>>|_]}=Req, _Db) ->
PathFront = "/" ++ couch_httpd:quote(binary_to_list(DbName)) ++ "/",
- RawSplit = regexp:split(MochiReq:get(raw_path),"_design%2F"),
- {ok, [PathFront|PathTail]} = RawSplit,
+ [PathFront|PathTail] = re:split(MochiReq:get(raw_path), "_design%2F",
+ [{return, list}]),
couch_httpd:send_redirect(Req, PathFront ++ "_design/" ++
mochiweb_util:join(PathTail, "_design%2F"));
@@ -1008,12 +1008,12 @@ extract_header_rev(Req, ExplicitRev) ->
parse_copy_destination_header(Req) ->
Destination = couch_httpd:header_value(Req, "Destination"),
- case regexp:match(Destination, "\\?") of
+ case re:run(Destination, "\\?", [{capture, none}]) of
nomatch ->
{list_to_binary(Destination), {0, []}};
- {match, _, _} ->
- {ok, [DocId, RevQueryOptions]} = regexp:split(Destination, "\\?"),
- {ok, [_RevQueryKey, Rev]} = regexp:split(RevQueryOptions, "="),
+ match ->
+ [DocId, RevQs] = re:split(Destination, "\\?", [{return, list}]),
+ [_RevQueryKey, Rev] = re:split(RevQs, "=", [{return, list}]),
{Pos, RevId} = couch_doc:parse_rev(Rev),
{list_to_binary(DocId), {Pos, [RevId]}}
end.