Fix using HTTP methods other than GET from plugins

Commit 3bde74c279 introduced a bug in the REST API. Methods other
than GET could not be used anymore  from plugins. For example it was not
possible anymore to delete projects with the delete-plugin using DELETE.

Bug: issue 2949
Change-Id: If90247ec4e0dad03b02d0a9e21202455fece90a7
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
(cherry picked from commit 3d227bbadf)
This commit is contained in:
Stefan Lay 2014-10-07 16:27:37 +02:00 committed by Edwin Kempin
parent 23e841476e
commit 036df27ba0

View File

@ -821,8 +821,7 @@ public class RestApiServlet extends HttpServlet {
if (core != null) {
return new ViewData(null, core);
} else {
name = "GET." + p.get(0);
core = views.get("gerrit", name);
core = views.get("gerrit", "GET." + p.get(0));
if (core instanceof AcceptsPost && "POST".equals(method)) {
@SuppressWarnings("unchecked")
AcceptsPost<RestResource> ap = (AcceptsPost<RestResource>) core;