Skip to content

Commit

Permalink
[UWS] Fix bug in UWSServlet: the destroyJob action in POST must be te…
Browse files Browse the repository at this point in the history
…sted before the setJobParam action....otherwise the setJobParam action is always applied which leads to a Forbidden error when trying to destroy a job.
  • Loading branch information
gmantele committed May 6, 2015
1 parent 48569a6 commit 94b00c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/uws/service/UWSServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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!");

Expand Down

0 comments on commit 94b00c5

Please sign in to comment.