diff --git a/sabre/dav/lib/DAV/CorePlugin.php b/sabre/dav/lib/DAV/CorePlugin.php index dbd8976b1..a402f5fd9 100644 --- a/sabre/dav/lib/DAV/CorePlugin.php +++ b/sabre/dav/lib/DAV/CorePlugin.php @@ -80,18 +80,18 @@ public function httpGet(RequestInterface $request, ResponseInterface $response) } if ('HEAD' === $request->getHeader('X-Sabre-Original-Method')) { - $body = ''; + $body = fopen('php://temp', 'r+'); } else { $body = $node->get(); - - // Converting string into stream, if needed. - if (is_string($body)) { - $stream = fopen('php://temp', 'r+'); - fwrite($stream, $body); - rewind($stream); - $body = $stream; - } } + // Converting string into stream, if needed. + if (is_string($body)) { + $stream = fopen('php://temp', 'r+'); + fwrite($stream, $body); + rewind($stream); + $body = $stream; + } + /* * TODO: getetag, getlastmodified, getsize should also be used using