From cb6e67e0dffe925794a700e6e5149ededaa8bf7a Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Wed, 9 Jun 2010 14:42:57 -0400 Subject: cleanup of customer_name code --- src/chttpd_db.erl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/chttpd_db.erl') 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), -- cgit v1.2.3