PROPFIND returns 400 Bad Request #46

Open
mlmorg opened this Issue Nov 5, 2012 · 3 comments

Comments

Projects
None yet
3 participants

mlmorg commented Nov 5, 2012

I noticed that a PROPFIND request with no body returns a 400 Bad Request. The offending line is here:

https://github.com/chrisroberts/dav4rack/blob/master/lib/dav4rack/controller.rb#L185

Why is this the case? It states in the RFC that "An empty PROPFIND request body MUST be treated as if it were an 'allprop' request." http://tools.ietf.org/html/rfc4918#page-36

Am I missing something here?

Thanks!

Owner

chrisroberts commented Nov 5, 2012

You are not. This was an oversight and will be fixed. Thanks for the report!

@schmurfy schmurfy added a commit to schmurfy/dav4rack that referenced this issue Nov 7, 2012

@schmurfy schmurfy bugfix (issue #46): empty body = allprop 7fd4b8b

It seems to me that this might have a more serious impact as some iPhones are sending requests like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <A:propfind xmlns:A="DAV:">
      <A:prop>
        <C:getctag xmlns:C="http://calendarserver.org/ns/"/>
        <A:sync-token/>
      </A:prop>
    </A:propfind>

and since properties remains empty in this case (see line https://github.com/chrisroberts/dav4rack/blob/master/lib/dav4rack/controller.rb#L195) thus the request is considered empty body and 400 response is returned and the client (iPhone in the case I'm experiencing) is hammering the server and user's battery is depleting

Anyone can confirm this?
How about merging @schmurfy patch?

Owner

chrisroberts commented Mar 19, 2013

Thanks for the bump. I will see about getting that pulled in from @schmurfy fork and getting a release put together shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment