If header checking lacks etag checks
------------------------------------

                 Key: JCR-1785
                 URL: https://issues.apache.org/jira/browse/JCR-1785
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-webdav
            Reporter: Julian Reschke


The evaluation of the WebDAV If header seems to lack Etag checks. For instance, 
this test case:


    public void testPutIfEtag() throws HttpException, IOException, 
DavException, URISyntaxException {
  
        String testuri = this.root + "iftest";
    
        int status;
        try {
            PutMethod put = new PutMethod(testuri);
            String condition = "<" + testuri + "> ([" + 
"\"an-etag-this-testcase-invented\"" + "])";
            put.setRequestEntity(new StringRequestEntity("1"));
            put.setRequestHeader("If", condition);
            status = this.client.executeMethod(put);
            assertEquals("status: " + status, 412, status);
        }
        finally {
            DeleteMethod delete = new DeleteMethod(testuri);
            status = this.client.executeMethod(delete);
            assertTrue("status: " + status, status == 200 || status == 204 || 
status == 404);
        }
    }

fails, as the PUT request gets executed, although it should have been rejected 
with Precondition Failed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to