Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ public static function handleRequest() {
}

// Handle WebDAV
if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
if ($_SERVER['REQUEST_METHOD'] === 'PROPFIND') {
// not allowed any more to prevent people
// mounting this root directly.
// Users need to mount remote.php/webdav instead.
Expand All @@ -1027,6 +1027,23 @@ public static function handleRequest() {
return;
}

$isOptionsRequestByWindows = false;
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS' && isset($_SERVER['HTTP_USER_AGENT'])) {
$isOptionsRequestByWindowsWebClient =
strpos($_SERVER['HTTP_USER_AGENT'], 'DavClnt') !== false;
}

// Handle WebDAV for native Windows mounts on discovery when Windows
// webclient is not yet running
//
// they request then the root of the domain, so this is not needed when
// installed into subdirectory (therefore the check for REQUEST_URI ===
// '/')
if ($isOptionsRequestByWindowsWebClient && isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] === '/') {
header('HTTP/1.1 200 OK');
return;
}

// Someone is logged in
if (OC_User::isLoggedIn()) {
OC_App::loadApps();
Expand Down