Do not check preconditions on REST parent resources

If 'If-None-Match: *' is specified this should only fail if the
specified REST resource already exists and not if the parent resource
exists.

Change-Id: I299ff4cdcd4d932401507eaca4f5807718be6dcd
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2013-05-15 15:26:15 +02:00
committed by Edwin Kempin
parent be0e5c698f
commit ecbba0d5f5

View File

@@ -215,7 +215,9 @@ public class RestApiServlet extends HttpServlet {
IdString id = path.remove(0);
try {
rsrc = rc.parse(rsrc, id);
checkPreconditions(req, rsrc);
if (path.isEmpty()) {
checkPreconditions(req, rsrc);
}
} catch (ResourceNotFoundException e) {
if (rc instanceof AcceptsCreate
&& path.isEmpty()