Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Return HTTP 405 for unsupported request method
  • Loading branch information
kxepal committed Oct 12, 2015
1 parent de5f328 commit 80fd81b3350dc96918b460b3bfb646fddade80f2
Showing 1 changed file with 9 additions and 2 deletions.
@@ -26,7 +26,9 @@ handle_membership_req(#httpd{method='GET',
couch_httpd:send_json(Req, {[
{all_nodes, lists:sort([node()|nodes()])},
{cluster_nodes, lists:sort(ClusterNodes)}
]}).
]});
handle_membership_req(#httpd{path_parts=[<<"_membership">>]}=Req) ->
chttpd:send_method_not_allowed(Req, "GET").

handle_shards_req(#httpd{method='GET',
path_parts=[_DbName, <<"_shards">>]} = Req, Db) ->
@@ -44,7 +46,12 @@ handle_shards_req(#httpd{method='GET',
couch_httpd:send_json(Req, {[
{range, Shard},
{nodes, Dbs}
]}).
]});
handle_shards_req(#httpd{path_parts=[_DbName, <<"_shards">>]}=Req, _Db) ->
chttpd:send_method_not_allowed(Req, "GET");
handle_shards_req(#httpd{path_parts=[_DbName, <<"_shards">>, _DocId]}=Req, _Db) ->
chttpd:send_method_not_allowed(Req, "GET").

%%
%% internal
%%

0 comments on commit 80fd81b

Please sign in to comment.