Commit 94b00c57 authored by gmantele's avatar gmantele
Browse files

[UWS] Fix bug in UWSServlet: the destroyJob action in POST must be tested...

[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.
parent 48569a6b
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -405,16 +405,16 @@ public abstract class UWSServlet extends HttpServlet implements UWS, UWSFactory
					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!");