[Pkg-owncloud-commits] [php-sabredav] 49/64: Fix for #572
David Prévot
taffit at moszumanska.debian.org
Thu Dec 11 15:13:26 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag 2.2.0alpha1
in repository php-sabredav.
commit 4e16fa25b55e12f79c911a2b444e6b951aaeb7e3
Author: Evert Pot <me at evertpot.com>
Date: Mon Dec 1 18:37:24 2014 -0500
Fix for #572
---
lib/DAV/CorePlugin.php | 2 +-
lib/DAV/Server.php | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/DAV/CorePlugin.php b/lib/DAV/CorePlugin.php
index 8547c3e..b878e26 100644
--- a/lib/DAV/CorePlugin.php
+++ b/lib/DAV/CorePlugin.php
@@ -250,7 +250,7 @@ class CorePlugin extends ServerPlugin {
$subRequest->setMethod('GET');
try {
- $this->server->invokeMethod($subRequest, $response);
+ $this->server->invokeMethod($subRequest, $response, false);
$response->setBody('');
} catch (Exception\NotImplemented $e) {
// Some clients may do HEAD requests on collections, however, GET
diff --git a/lib/DAV/Server.php b/lib/DAV/Server.php
index ce261b4..d9b2958 100644
--- a/lib/DAV/Server.php
+++ b/lib/DAV/Server.php
@@ -446,9 +446,10 @@ class Server extends EventEmitter {
*
* @param RequestInterface $request
* @param ResponseInterface $response
+ * @param $sendResponse Wether to send the HTTP response to the DAV client.
* @return void
*/
- function invokeMethod(RequestInterface $request, ResponseInterface $response) {
+ function invokeMethod(RequestInterface $request, ResponseInterface $response, $sendResponse = true) {
$method = $request->getMethod();
@@ -476,8 +477,10 @@ class Server extends EventEmitter {
if (!$this->emit('afterMethod:' . $method, [$request, $response])) return;
if (!$this->emit('afterMethod', [$request, $response])) return;
- $this->sapi->sendResponse($response);
- $this->emit('afterResponse', [$request, $response]);
+ if ($sendResponse) {
+ $this->sapi->sendResponse($response);
+ $this->emit('afterResponse', [$request, $response]);
+ }
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git
More information about the Pkg-owncloud-commits
mailing list