mirror of
https://github.com/nextcloud/server.git
synced 2026-03-21 10:00:33 -04:00
fix(dav): do not require CSRF for safe and indempotent HTTP methods
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
9dea6185ad
commit
fa63e646d4
1 changed files with 3 additions and 2 deletions
|
|
@ -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…
Reference in a new issue