1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-09 06:17:58 +00:00

Set "SameSite=None" if CSRF Protection is disabled

PR #18843.
This commit is contained in:
七海千秋 2023-04-16 19:27:49 +08:00 committed by GitHub
parent eaee38a19e
commit 1e400df324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -683,6 +683,8 @@ void WebApplication::sessionStart()
QByteArray cookieRawForm = cookie.toRawForm();
if (m_isCSRFProtectionEnabled)
cookieRawForm.append("; SameSite=Strict");
else if (cookie.isSecure())
cookieRawForm.append("; SameSite=None");
setHeader({Http::HEADER_SET_COOKIE, QString::fromLatin1(cookieRawForm)});
}