HTTPDownloader: Fix user agent sending on Windows/Android

This commit is contained in:
Connor McLaughlin
2021-04-04 12:55:03 +10:00
parent 251043f11a
commit d41b5be908
10 changed files with 40 additions and 33 deletions

View File

@ -4,26 +4,21 @@
#include "common/timer.h"
Log_SetChannel(HTTPDownloader);
static constexpr char DEFAULT_USER_AGENT[] =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0";
static constexpr float DEFAULT_TIMEOUT_IN_SECONDS = 30;
static constexpr u32 DEFAULT_MAX_ACTIVE_REQUESTS = 4;
namespace FrontendCommon {
const char HTTPDownloader::DEFAULT_USER_AGENT[] =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0";
HTTPDownloader::HTTPDownloader()
: m_user_agent(DEFAULT_USER_AGENT), m_timeout(DEFAULT_TIMEOUT_IN_SECONDS),
m_max_active_requests(DEFAULT_MAX_ACTIVE_REQUESTS)
: m_timeout(DEFAULT_TIMEOUT_IN_SECONDS), m_max_active_requests(DEFAULT_MAX_ACTIVE_REQUESTS)
{
}
HTTPDownloader::~HTTPDownloader() = default;
void HTTPDownloader::SetUserAgent(std::string name)
{
m_user_agent = std::move(name);
}
void HTTPDownloader::SetTimeout(float timeout)
{
m_timeout = timeout;