Browse Source

fix(dav): do not require CSRF for safe and indempotent HTTP methods

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/51457/head
Ferdinand Thiessen 1 year ago
parent
commit
fa63e646d4
No known key found for this signature in database GPG Key ID: 45FAE7268762B400
  1. 5
      apps/dav/lib/Connector/Sabre/Auth.php

5
apps/dav/lib/Connector/Sabre/Auth.php

@ -118,8 +118,9 @@ class Auth extends AbstractBasic {
* 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'];
if (in_array($this->request->getMethod(), $methodsWithoutCsrf)) {
return false;
}

Loading…
Cancel
Save