WebUI: Display error when download fails

Previously we would still download the file but it would contain the error response, resulting in an invalid file.
To test: export a .torrent file for a torrent that hasn't yet downloaded metadata

PR #21696.

Signed-off-by: Thomas Piccirello <thomas@piccirello.com>
This commit is contained in:
Thomas Piccirello 2024-11-23 05:03:43 -03:00 committed by GitHub
parent 61ff683f11
commit 78a5e4ff3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 9 deletions

View file

@ -467,7 +467,7 @@ void WebApplication::configure()
const QString contentSecurityPolicy =
(m_isAltUIUsed
? QString()
: u"default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none'; form-action 'self';"_s)
: u"default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none'; form-action 'self'; frame-src 'self' blob:;"_s)
+ (isClickjackingProtectionEnabled ? u" frame-ancestors 'self';"_s : QString())
+ (m_isHttpsEnabled ? u" upgrade-insecure-requests;"_s : QString());
if (!contentSecurityPolicy.isEmpty())