jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Reschke <julian.resc...@gmx.de>
Subject Re: [jira] Updated: (JCR-389) WebDAV server should treat non-wellformed XML in request bodies as error
Date Thu, 06 Apr 2006 18:06:36 GMT
Brian Moseley wrote:
> On 4/6/06, Julian Reschke (JIRA) <jira@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

View raw message