Fix using HTTP methods other than GET from plugins
Commit 3bde74c2797 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 3d227bbadfa234bcac7400cf41030423bf183ff3)
This commit is contained in:
parent
23e841476e
commit
036df27ba0
@ -821,8 +821,7 @@ public class RestApiServlet extends HttpServlet {
|
|||||||
if (core != null) {
|
if (core != null) {
|
||||||
return new ViewData(null, core);
|
return new ViewData(null, core);
|
||||||
} else {
|
} else {
|
||||||
name = "GET." + p.get(0);
|
core = views.get("gerrit", "GET." + p.get(0));
|
||||||
core = views.get("gerrit", name);
|
|
||||||
if (core instanceof AcceptsPost && "POST".equals(method)) {
|
if (core instanceof AcceptsPost && "POST".equals(method)) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
AcceptsPost<RestResource> ap = (AcceptsPost<RestResource>) core;
|
AcceptsPost<RestResource> ap = (AcceptsPost<RestResource>) core;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user