Merge pull request #5507 from owncloud/webdav-removeredirectfromindex

Remove WebDAV redirect from the root path
This commit is contained in:
Thomas Müller 2013-10-24 10:05:21 -07:00
commit 54e9d8c306
2 changed files with 5 additions and 31 deletions

View File

@ -1,30 +0,0 @@
<?php
/**
* ownCloud
*
* @author Frank Karlitschek
* @author Jakob Sack
* @copyright 2012 Frank Karlitschek frank@owncloud.org
* @copyright 2011 Jakob Sack kde@jakobsack.de
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// only need filesystem apps
$RUNTIME_APPTYPES=array('filesystem', 'authentication');
require_once '../lib/base.php';
$baseuri = OC::$WEBROOT. '/files/webdav.php';
require_once 'apps/files/appinfo/remote.php';

View File

@ -688,7 +688,11 @@ class OC {
}
// Handle WebDAV
if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
header('location: ' . OC_Helper::linkToRemote('webdav'));
// not allowed any more to prevent people
// mounting this root directly.
// Users need to mount remote.php/webdav instead.
header('HTTP/1.1 405 Method Not Allowed');
header('Status: 405 Method Not Allowed');
return;
}