get csrf token in request; Test for prefix 'http-' in csrf token header

This commit is contained in:
Marius Karstedt
2021-03-21 11:40:37 +01:00
parent e78040aabd
commit 05e5461acb
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -147,6 +147,15 @@ class Request
return $this->getHeader('php-auth-pw');
}
/**
* Get the csrf token
* @return string|null
*/
public function getCsrfToken(): ?string
{
return $this->getHeader('x-csrf-token') ?? $this->getHeader('http-x-csrf-token');
}
/**
* Get all headers
* @return array