mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-05 14:47:25 +03:00
parent
3fcc298539
commit
cbf7c09bf4
1 changed files with 3 additions and 6 deletions
|
@ -320,14 +320,11 @@ void Net::DownloadManager::processRequest(DownloadHandlerImpl *downloadHandler)
|
|||
|
||||
const DownloadRequest downloadRequest = downloadHandler->downloadRequest();
|
||||
QNetworkRequest request {downloadRequest.url()};
|
||||
|
||||
if (downloadRequest.userAgent().isEmpty())
|
||||
request.setRawHeader("User-Agent", getBrowserUserAgent());
|
||||
else
|
||||
request.setRawHeader("User-Agent", downloadRequest.userAgent().toUtf8());
|
||||
request.setHeader(QNetworkRequest::UserAgentHeader, (downloadRequest.userAgent().isEmpty()
|
||||
? getBrowserUserAgent() : downloadRequest.userAgent().toUtf8()));
|
||||
|
||||
// Spoof HTTP Referer to allow adding torrent link from Torcache/KickAssTorrents
|
||||
request.setRawHeader("Referer", request.url().toEncoded().data());
|
||||
request.setRawHeader("Referer", request.url().toEncoded());
|
||||
#ifdef QT_NO_COMPRESS
|
||||
// The macro "QT_NO_COMPRESS" defined in QT will disable the zlib related features
|
||||
// and reply data auto-decompression in QT will also be disabled. But we can support
|
||||
|
|
Loading…
Reference in a new issue