You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2006/04/06 18:13:25 UTC

[jira] Created: (JCR-389) WebDAV server should treat non-wellformed XML in request bodies as error

WebDAV server should treat non-wellformed XML in request bodies as error
------------------------------------------------------------------------

         Key: JCR-389
         URL: http://issues.apache.org/jira/browse/JCR-389
     Project: Jackrabbit
        Type: Bug

  Components: webdav  
    Versions: 1.0    
    Reporter: Julian Reschke
    Priority: Minor


The WebDAV server should treat non-wellformed XML request bodies as errors (instead of treating the request as if the request body was missing).

(causes Litmus test suite failure in test case propfind_invalid)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Updated: (JCR-389) WebDAV server should treat non-wellformed XML in request bodies as error

Posted by Julian Reschke <ju...@gmx.de>.
Brian Moseley wrote:
> On 4/6/06, Julian Reschke (JIRA) <ji...@apache.org> wrote:
>>      [ http://issues.apache.org/jira/browse/JCR-389?page=all ]
>>
>> Julian Reschke updated JCR-389:
>> -------------------------------
>>
>>     Attachment: diffs
>>
>> This patch adds DavException to the signature of getRequestDocument(), and attempts to make sure that an exception is thrown when a request body is present but not well-formed (wrapping the InputStream with a BufferedInputStream and peeking at the first byte was the most reliable way I could think of to find out whether there actually was a request body).
> 
> looks fine to me. i've used PushbackInputStream to do the same thing,
> but i don't have a preference either way. i'm throwing
> IllegalArgumentException in order to avoid changing the method
> signature, but i prefer the way you've done it.

At a later point of time, we may want to return more details in the 400 
response body, and that IMHO justifies the DavException.

> another change i've made to this method is to return null when there's
> no request content. this lets the servet layer behave differently if
> there's no content or if there's content but it can't be read. this is
> useful for caldav where a MKCALENDAR can have a request body but does
> not have to, and the servlet layer needs to know which is the case.

That's correct, the patch does that as well (for instance, that's also 
required for OPTIONS and PROPFIND).

Best regards, Julian

Re: [jira] Updated: (JCR-389) WebDAV server should treat non-wellformed XML in request bodies as error

Posted by Brian Moseley <bc...@osafoundation.org>.
On 4/6/06, Julian Reschke (JIRA) <ji...@apache.org> wrote:
>      [ http://issues.apache.org/jira/browse/JCR-389?page=all ]
>
> Julian Reschke updated JCR-389:
> -------------------------------
>
>     Attachment: diffs
>
> This patch adds DavException to the signature of getRequestDocument(), and attempts to make sure that an exception is thrown when a request body is present but not well-formed (wrapping the InputStream with a BufferedInputStream and peeking at the first byte was the most reliable way I could think of to find out whether there actually was a request body).

looks fine to me. i've used PushbackInputStream to do the same thing,
but i don't have a preference either way. i'm throwing
IllegalArgumentException in order to avoid changing the method
signature, but i prefer the way you've done it.

another change i've made to this method is to return null when there's
no request content. this lets the servet layer behave differently if
there's no content or if there's content but it can't be read. this is
useful for caldav where a MKCALENDAR can have a request body but does
not have to, and the servlet layer needs to know which is the case.

[jira] Updated: (JCR-389) WebDAV server should treat non-wellformed XML in request bodies as error

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-389?page=all ]

Julian Reschke updated JCR-389:
-------------------------------

    Attachment: diffs

This patch adds DavException to the signature of getRequestDocument(), and attempts to make sure that an exception is thrown when a request body is present but not well-formed (wrapping the InputStream with a BufferedInputStream and peeking at the first byte was the most reliable way I could think of to find out whether there actually was a request body).


> WebDAV server should treat non-wellformed XML in request bodies as error
> ------------------------------------------------------------------------
>
>          Key: JCR-389
>          URL: http://issues.apache.org/jira/browse/JCR-389
>      Project: Jackrabbit
>         Type: Bug

>   Components: webdav
>     Versions: 1.0
>     Reporter: Julian Reschke
>     Priority: Minor
>  Attachments: diffs
>
> The WebDAV server should treat non-wellformed XML request bodies as errors (instead of treating the request as if the request body was missing).
> (causes Litmus test suite failure in test case propfind_invalid)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (JCR-389) WebDAV server should treat non-wellformed XML in request bodies as error

Posted by "angela (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-389?page=all ]
     
angela resolved JCR-389:
------------------------

    Resolution: Fixed

commited patch rev. 392905 .

In addition removed 'todo' mark stating that invalid xml with propfind should result in 404 instead
of treating as request for all-props.

Note regarding the interface 'DavServletRequest.java':
Method signature with 'getRequestDocument' has changed and now allows to throws DavException.
I think this modification is a) justifiable and b) should not cause major compatibility issues.  The AbstractWebdavServlet as well as all calling methods in the DavServletRequest and extensions  have already been changed to throw DavException before the 1.0 release.


> WebDAV server should treat non-wellformed XML in request bodies as error
> ------------------------------------------------------------------------
>
>          Key: JCR-389
>          URL: http://issues.apache.org/jira/browse/JCR-389
>      Project: Jackrabbit
>         Type: Bug

>   Components: webdav
>     Versions: 1.0
>     Reporter: Julian Reschke
>     Assignee: angela
>     Priority: Minor
>  Attachments: diffs
>
> The WebDAV server should treat non-wellformed XML request bodies as errors (instead of treating the request as if the request body was missing).
> (causes Litmus test suite failure in test case propfind_invalid)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (JCR-389) WebDAV server should treat non-wellformed XML in request bodies as error

Posted by "angela (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-389?page=all ]
     
angela closed JCR-389:
----------------------


> WebDAV server should treat non-wellformed XML in request bodies as error
> ------------------------------------------------------------------------
>
>          Key: JCR-389
>          URL: http://issues.apache.org/jira/browse/JCR-389
>      Project: Jackrabbit
>         Type: Bug

>   Components: webdav
>     Versions: 1.0
>     Reporter: Julian Reschke
>     Assignee: angela
>     Priority: Minor
>  Attachments: diffs
>
> The WebDAV server should treat non-wellformed XML request bodies as errors (instead of treating the request as if the request body was missing).
> (causes Litmus test suite failure in test case propfind_invalid)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (JCR-389) WebDAV server should treat non-wellformed XML in request bodies as error

Posted by "angela (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-389?page=all ]

angela reassigned JCR-389:
--------------------------

    Assign To: angela

> WebDAV server should treat non-wellformed XML in request bodies as error
> ------------------------------------------------------------------------
>
>          Key: JCR-389
>          URL: http://issues.apache.org/jira/browse/JCR-389
>      Project: Jackrabbit
>         Type: Bug

>   Components: webdav
>     Versions: 1.0
>     Reporter: Julian Reschke
>     Assignee: angela
>     Priority: Minor
>  Attachments: diffs
>
> The WebDAV server should treat non-wellformed XML request bodies as errors (instead of treating the request as if the request body was missing).
> (causes Litmus test suite failure in test case propfind_invalid)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira