Skip to content

Commit

Permalink
Enable per-view-shard access
Browse files Browse the repository at this point in the history
  • Loading branch information
wohali committed Feb 1, 2020
1 parent 8f2fbec commit 3aab21c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/couch/src/couch_httpd_db.erl
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,15 @@ handle_design_req(#httpd{
false -> ok
end,

% load ddoc
% maybe load ddoc through fabric
DesignId = <<"_design/", DesignName/binary>>,
DDoc = couch_httpd_db:couch_doc_open(Db, DesignId, nil, [ejson_body]),
case couch_httpd_db:couch_doc_open(Db, DesignId, nil, [ejson_body]) of
not_found ->
DbName = mem3:dbname(couch_db:name(Db)),
{ok, DDoc} = fabric:open_doc(DbName, DesignId, [?ADMIN_CTX]);
DDoc ->
ok
end,
Handler = couch_util:dict_find(Action, DesignUrlHandlers, fun(_, _, _) ->
throw({not_found, <<"missing handler: ", Action/binary>>})
end),
Expand Down

0 comments on commit 3aab21c

Please sign in to comment.