summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-07-10 15:50:17 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-12 11:18:49 -0400
commit25b9b2d936c07162b904b923e3308b56207888d7 (patch)
tree8e16f7c62ee019cecc646676284795d3b9dec09e
parent75c76c2ac385b1b88d1d1202e50e6cab929e0f89 (diff)
thank you dialyzer
-rw-r--r--src/chttpd_db.erl21
-rw-r--r--src/chttpd_view.erl2
2 files changed, 11 insertions, 12 deletions
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index aa7ba1c7..dfdba6a0 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -111,17 +111,13 @@ is_old_couch(Resp) ->
string:str(UserAgent, "CouchDB/0") > 0
end.
-handle_compact_req(#httpd{method='POST',path_parts=[DbName,_,Id|_]}=Req, _Db) ->
- ok = ?COUCH:compact_view_group(DbName, Id),
- send_json(Req, 202, {[{ok, true}]});
-
handle_compact_req(Req, _) ->
Msg = <<"Compaction is handled automatically by Cloudant">>,
- chttpd:send_error(Req, 403, Msg).
+ couch_httpd:send_error(Req, 403, forbidden, Msg).
handle_view_cleanup_req(Req, _) ->
Msg = <<"Old view indices are purged automatically by Cloudant">>,
- chttpd:send_error(Req, 403, Msg).
+ couch_httpd:send_error(Req, 403, forbidden, Msg).
handle_design_req(#httpd{
path_parts=[_DbName, _Design, Name, <<"_",_/binary>> = Action | _Rest],
@@ -282,11 +278,14 @@ db_req(#httpd{path_parts=[_,<<"_bulk_docs">>]}=Req, _Db) ->
db_req(#httpd{method='POST',path_parts=[_,<<"_purge">>]}=Req, Db) ->
{IdsRevs} = chttpd:json_body_obj(Req),
IdsRevs2 = [{Id, couch_doc:parse_revs(Revs)} || {Id, Revs} <- IdsRevs],
-
- case ?COUCH:purge_docs(Db, IdsRevs2) of
+ case fabric:purge_docs(Db, IdsRevs2) of
{ok, PurgeSeq, PurgedIdsRevs} ->
- PurgedIdsRevs2 = [{Id, couch_doc:rev_to_strs(Revs)} || {Id, Revs} <- PurgedIdsRevs],
- send_json(Req, 200, {[{<<"purge_seq">>, PurgeSeq}, {<<"purged">>, {PurgedIdsRevs2}}]});
+ PurgedIdsRevs2 = [{Id, couch_doc:revs_to_strs(Revs)} || {Id, Revs}
+ <- PurgedIdsRevs],
+ send_json(Req, 200, {[
+ {<<"purge_seq">>, PurgeSeq},
+ {<<"purged">>, {PurgedIdsRevs2}}
+ ]});
Error ->
throw(Error)
end;
@@ -638,7 +637,7 @@ db_attachment_req(#httpd{method='GET'}=Req, Db, DocId, FileNameParts) ->
Etag = chttpd:doc_etag(Doc),
ReqAcceptsAttEnc = lists:member(
atom_to_list(Enc),
- chttpd:accepted_encodings(Req)
+ couch_httpd:accepted_encodings(Req)
),
Headers = [
{"ETag", Etag},
diff --git a/src/chttpd_view.erl b/src/chttpd_view.erl
index 42972870..e09487c8 100644
--- a/src/chttpd_view.erl
+++ b/src/chttpd_view.erl
@@ -90,7 +90,7 @@ handle_view_req(Req, _Db, _DDoc) ->
handle_temp_view_req(Req, _Db) ->
Msg = <<"Temporary views are not supported by Cloudant">>,
- chttpd:send_error(Req, 403, Msg).
+ chttpd:send_error(Req, 403, forbidden, Msg).
reverse_key_default(?MIN_STR) -> ?MAX_STR;
reverse_key_default(?MAX_STR) -> ?MIN_STR;