From 94b00c57d64482c832add62b81df19eed7c0dc9f Mon Sep 17 00:00:00 2001 From: gmantele Date: Wed, 6 May 2015 14:47:23 +0200 Subject: [PATCH] [UWS] Fix bug in UWSServlet: the destroyJob action in POST must be tested before the setJobParam action....otherwise the setJobParam action is always applied which leads to a Forbidden error when trying to destroy a job. --- src/uws/service/UWSServlet.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/uws/service/UWSServlet.java b/src/uws/service/UWSServlet.java index d1bc01ea..52c4201b 100644 --- a/src/uws/service/UWSServlet.java +++ b/src/uws/service/UWSServlet.java @@ -405,16 +405,16 @@ else if (requestUrl.hasJobList() && requestUrl.hasJob() && requestUrl.getAttribu uwsAction = UWSAction.SET_UWS_PARAMETER; doSetUWSParameter(requestUrl, req, resp, user); - }// SET JOB PARAMETER: - else if (requestUrl.hasJobList() && requestUrl.hasJob() && (!requestUrl.hasAttribute() || requestUrl.getAttributes().length == 1 && requestUrl.getAttributes()[0].equalsIgnoreCase(UWSJob.PARAM_PARAMETERS)) && UWSToolBox.getNbParameters(req) > 0){ - uwsAction = UWSAction.SET_JOB_PARAM; - doSetJobParam(requestUrl, req, resp, user); - }// DESTROY JOB: else if (requestUrl.hasJobList() && requestUrl.hasJob() && UWSToolBox.hasParameter(UWSJob.PARAM_ACTION, UWSJob.ACTION_DELETE, req, false)){ uwsAction = UWSAction.DESTROY_JOB; doDestroyJob(requestUrl, req, resp, user); + }// SET JOB PARAMETER: + else if (requestUrl.hasJobList() && requestUrl.hasJob() && (!requestUrl.hasAttribute() || requestUrl.getAttributes().length == 1 && requestUrl.getAttributes()[0].equalsIgnoreCase(UWSJob.PARAM_PARAMETERS)) && UWSToolBox.getNbParameters(req) > 0){ + uwsAction = UWSAction.SET_JOB_PARAM; + doSetJobParam(requestUrl, req, resp, user); + }else throw new UWSException(UWSException.NOT_IMPLEMENTED, "Unknown UWS action!");