summaryrefslogtreecommitdiff
path: root/src/chttpd_external.erl
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-08-12 11:31:13 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-18 14:17:23 -0400
commite1dda6bc6219d7ac33ea75d56b9c02f5063b4787 (patch)
treeed09b77d6b955ec8cb2e572b5675883459959e4e /src/chttpd_external.erl
parent974f97224523bdc09bafa3f1ce18c31b7dc78986 (diff)
remove some cloudant stuff
Diffstat (limited to 'src/chttpd_external.erl')
-rw-r--r--src/chttpd_external.erl17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/chttpd_external.erl b/src/chttpd_external.erl
index ffde0ee7..51f32e10 100644
--- a/src/chttpd_external.erl
+++ b/src/chttpd_external.erl
@@ -63,7 +63,7 @@ json_req_obj(#httpd{mochi_req=Req,
method=Method,
path_parts=Path,
req_body=ReqBody
- } = HttpReq, Db, DocId) ->
+ }, Db, DocId) ->
Body = case ReqBody of
undefined -> Req:recv_body();
Else -> Else
@@ -78,27 +78,18 @@ json_req_obj(#httpd{mochi_req=Req,
Hlist = mochiweb_headers:to_list(Headers),
{ok, Info} = fabric:get_db_info(Db),
- % send correct path to customer - BugzID 6849
- CustomerBin = list_to_binary(cloudant_util:customer_name(HttpReq)),
- Len = byte_size(CustomerBin),
- FixedPath = case Path of
- [<<CustomerBin:Len/binary, "/", DbName/binary>> | Rest] ->
- [DbName | Rest];
- NoCustomer ->
- NoCustomer
- end,
% add headers...
- {[{<<"info">>, {cloudant_util:customer_db_info(HttpReq, Info)}},
+ {[{<<"info">>, {Info}},
{<<"id">>, DocId},
{<<"method">>, Method},
- {<<"path">>, FixedPath},
+ {<<"path">>, Path},
{<<"query">>, json_query_keys(to_json_terms(Req:parse_qs()))},
{<<"headers">>, to_json_terms(Hlist)},
{<<"body">>, Body},
{<<"peer">>, ?l2b(Req:get(peer))},
{<<"form">>, to_json_terms(ParsedForm)},
{<<"cookie">>, to_json_terms(Req:parse_cookie())},
- {<<"userCtx">>, couch_util:json_user_ctx(Db#db{name=hd(FixedPath)})}]}.
+ {<<"userCtx">>, couch_util:json_user_ctx(Db)}]}.
to_json_terms(Data) ->
to_json_terms(Data, []).