diff options
author | Adam Kocoloski <adam@cloudant.com> | 2010-06-09 14:42:57 -0400 |
---|---|---|
committer | Adam Kocoloski <adam@cloudant.com> | 2010-08-12 11:18:44 -0400 |
commit | cb6e67e0dffe925794a700e6e5149ededaa8bf7a (patch) | |
tree | d902221e75b26a9cea3e1331ceda6a10f79c1226 /src/chttpd_db.erl | |
parent | 4da7e07ff67f9a0e29cd09c7c91ed3606ac01bdf (diff) |
cleanup of customer_name code
Diffstat (limited to 'src/chttpd_db.erl')
-rw-r--r-- | src/chttpd_db.erl | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl index 94a43e20..1ae5629d 100644 --- a/src/chttpd_db.erl +++ b/src/chttpd_db.erl @@ -165,10 +165,8 @@ do_db_req(#httpd{path_parts=[DbName|_]}=Req, Fun) -> Fun(Req, #db{name=DbName}). db_req(#httpd{method='GET',path_parts=[DbName]}=Req, _Db) -> - Customer = cloudant_util:customer_name(chttpd:header_value(Req, "X-Cloudant-User"), - chttpd:header_value(Req, "Host")), - {ok, DbInfo} = ?COUCH:get_db_info(DbName, Customer), - send_json(Req, {DbInfo}); + {ok, DbInfo} = fabric:get_db_info(DbName), + send_json(Req, {cloudant_util:customer_db_info(Req, DbInfo)}); db_req(#httpd{method='POST',path_parts=[DbName]}=Req, Db) -> Doc = couch_doc:from_json_obj(chttpd:json_body(Req)), @@ -332,9 +330,7 @@ db_req(#httpd{method='GET',path_parts=[_,<<"_all_docs_by_seq">>]}=Req, Db) -> direction = Dir } = QueryArgs = chttpd_view:parse_view_params(Req, nil, map), - Customer = cloudant_util:customer_name(chttpd:header_value(Req, "X-Cloudant-User"), - chttpd:header_value(Req, "Host")), - {ok, Info} = ?COUCH:get_db_info(Db, Customer), + {ok, Info} = fabric:get_db_info(Db), CurrentEtag = chttpd:make_etag(Info), chttpd:etag_respond(Req, CurrentEtag, fun() -> TotalRowCount = couch_util:get_value(doc_count, Info), |