Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAV\Client: Request body missing on PROPFIND after HEAD request #47

Closed
evert opened this issue May 7, 2015 · 1 comment
Closed

DAV\Client: Request body missing on PROPFIND after HEAD request #47

evert opened this issue May 7, 2015 · 1 comment
Assignees
Labels

Comments

@evert
Copy link
Member

evert commented May 7, 2015

Moved from https://github.com/fruux/sabre-dav/issues/649

When using the Sabre\DAV\Client to do a HEAD request, followed by a PROPFIND request, the latter fails because of a missing response body.

Reason for this problem is that the curl settings (including the CURLOPT_NOBODY option) are not cleared/reset between requests.

Test case:

<?php
require 'vendor/autoload.php';
use Sabre\DAV;

$client = new Sabre\DAV\Client(
    array(
        'userName' => 'admin',
        'password' => 'admin',
        'baseUri'  => 'http://wolke.bogo/remote.php/webdav/'
    )
);
//check if file exists
$client->request('HEAD', 'Notes');
//then fetch properties
$res = $client->propFind('Notes', array('{DAV:}resourcetype'), 1);
var_dump($res);
?>

Result:

PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message
 'The body passed to parseMultiStatus could not be parsed. Is it really xml?'

This happens with sabre/dav 2.1.3.

@evert evert added the bug label May 7, 2015
@evert
Copy link
Member Author

evert commented May 7, 2015

Needs to be fixed in the 3.0 branch of this project.

@evert evert self-assigned this May 7, 2015
@evert evert closed this as completed in 6b06c03 May 11, 2015
reviewtypo3org pushed a commit to TYPO3-extensions/fal_webdav that referenced this issue May 17, 2015
cURL does not seem to correctly set the options to retrieve PROPFIND
results after HEAD requests were sent within the same cURL context; see
<sabre-io/http#47> for more information.

The bug was fixed in the meantime, but sabre/dav does still use an old
version of sabre/http. This commit fixes `composer.json` to include
the new version with an alias.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant