Skip to content
Merged
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
5 changes: 3 additions & 2 deletions apps/dav/lib/Connector/Sabre/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ public function check(RequestInterface $request, ResponseInterface $response) {
* Checks whether a CSRF check is required on the request
*/
private function requiresCSRFCheck(): bool {
// GET requires no check at all
if ($this->request->getMethod() === 'GET') {

$methodsWithoutCsrf = ['GET', 'HEAD', 'OPTIONS'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A HEAD request is turned into a GET request by the web server, so PHP will never see any HEAD requests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that true for all webserver configurations?

if (in_array($this->request->getMethod(), $methodsWithoutCsrf)) {
return false;
}

Expand Down
Loading