mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-07 07:37:24 +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();
|
const DownloadRequest downloadRequest = downloadHandler->downloadRequest();
|
||||||
QNetworkRequest request {downloadRequest.url()};
|
QNetworkRequest request {downloadRequest.url()};
|
||||||
|
request.setHeader(QNetworkRequest::UserAgentHeader, (downloadRequest.userAgent().isEmpty()
|
||||||
if (downloadRequest.userAgent().isEmpty())
|
? getBrowserUserAgent() : downloadRequest.userAgent().toUtf8()));
|
||||||
request.setRawHeader("User-Agent", getBrowserUserAgent());
|
|
||||||
else
|
|
||||||
request.setRawHeader("User-Agent", downloadRequest.userAgent().toUtf8());
|
|
||||||
|
|
||||||
// Spoof HTTP Referer to allow adding torrent link from Torcache/KickAssTorrents
|
// 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
|
#ifdef QT_NO_COMPRESS
|
||||||
// The macro "QT_NO_COMPRESS" defined in QT will disable the zlib related features
|
// 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
|
// and reply data auto-decompression in QT will also be disabled. But we can support
|
||||||
|
|
Loading…
Reference in a new issue