mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-26 19:26:59 +03:00
[WebUI] relax CSRF defense. Closes #6882.
Allow HTTP request which has neither Origin nor Referer header included
This commit is contained in:
parent
b5c0d90e9c
commit
cdb8f4bc61
1 changed files with 3 additions and 3 deletions
|
@ -392,9 +392,9 @@ bool AbstractWebApplication::isCrossSiteRequest(const Http::Request &request) co
|
|||
const QString refererValue = request.headers.value(Http::HEADER_REFERER);
|
||||
|
||||
if (originValue.isEmpty() && refererValue.isEmpty()) {
|
||||
if ((request.path == QLatin1String("/")) || (request.path == QLatin1String("/favicon.ico")))
|
||||
return false; // normal request
|
||||
return true;
|
||||
// owasp.org recommends to block this request, but doing so will inevitably lead Web API users to spoof headers
|
||||
// so lets be permissive here
|
||||
return false;
|
||||
}
|
||||
|
||||
// sent with CORS requests, as well as with POST requests
|
||||
|
|
Loading…
Reference in a new issue