summaryrefslogtreecommitdiffstats
path: root/lib/private/connector
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-02-18 13:41:42 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-02-23 22:27:23 +0100
commit432d7be8cc66da0de1e174522333e5b5dd004c91 (patch)
tree02a7c62ef6c01a75411aa03b411f72136beeae42 /lib/private/connector
parent5b6caf763cd3f5365c9ea1c49528c738188f0e8c (diff)
downloadnextcloud-server-432d7be8cc66da0de1e174522333e5b5dd004c91.tar.gz
nextcloud-server-432d7be8cc66da0de1e174522333e5b5dd004c91.zip
Show a empty response for GET on non-files instead of the Browser Plugin
Diffstat (limited to 'lib/private/connector')
-rw-r--r--lib/private/connector/sabre/dummygetresponseplugin.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/private/connector/sabre/dummygetresponseplugin.php b/lib/private/connector/sabre/dummygetresponseplugin.php
new file mode 100644
index 00000000000..0b78fe7dcb3
--- /dev/null
+++ b/lib/private/connector/sabre/dummygetresponseplugin.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Connector\Sabre;
+
+/**
+ * Class DummyGetResponsePlugin is a plugin used to not show a "Not implemented"
+ * error to clients that rely on verifying the functionality of the ownCloud
+ * WebDAV backend using a simple GET to /.
+ *
+ * This is considered a legacy behaviour and implementers should consider sending
+ * a PROPFIND request instead to verify whether the WebDAV component is working
+ * properly.
+ *
+ * FIXME: Remove once clients are all compliant.
+ *
+ * @package OC\Connector\Sabre
+ */
+class DummyGetResponsePlugin extends \Sabre\DAV\ServerPlugin {
+ /** @var \Sabre\DAV\Server */
+ protected $server;
+
+ /**
+ * @param \Sabre\DAV\Server $server
+ * @return void
+ */
+ function initialize(\Sabre\DAV\Server $server) {
+ $this->server = $server;
+ $this->server->on('method:GET', [$this,'httpGet'], 200);
+ }
+
+ /**
+ * @return false
+ */
+ function httpGet() {
+ return false;
+ }
+}