jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Moseley" <...@osafoundation.org>
Subject Re: [jira] Updated: (JCR-389) WebDAV server should treat non-wellformed XML in request bodies as error
Date Thu, 06 Apr 2006 16:36:38 GMT
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.

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.

Mime
View raw message