-
Notifications
You must be signed in to change notification settings - Fork 357
Open
Description
When attempting to connect SabreDAV with a Windows, the server responds with a 401 Unauthorized status code for the OPTIONS request. This causes the Windows to abort the connection. Windows relies on the OPTIONS response to determine the available methods. Ideally, OPTIONS requests should not require authentication.
So I created a custom plugin to allow unauthenticated OPTIONS requests. The code is as follows:
<?php
namespace ProjectK\DAV\Auth\Plugin;
class Plugin extends \Sabre\DAV\Auth\Plugin
{
public function initialize(\Sabre\DAV\Server $server)
{
$server->on('beforeMethod:*', function(\Sabre\HTTP\RequestInterface $request, \Sabre\HTTP\ResponseInterface $response) {
if ($request->getMethod() !== 'OPTIONS')
{
$this->beforeMethod($request, $response);
}
}, 10);
}
}
Is this behavior intentional, and if so, could you clarify the reasoning? If not, can this be considered a bug, and is there a plan to address it?
Metadata
Metadata
Assignees
Labels
No labels