diff --git a/src/libcalamares/geoip/Handler.cpp b/src/libcalamares/geoip/Handler.cpp index d954b8fc0..648ea69f4 100644 --- a/src/libcalamares/geoip/Handler.cpp +++ b/src/libcalamares/geoip/Handler.cpp @@ -113,7 +113,9 @@ do_query( Handler::Type type, const QString& url, const QString& selector ) return RegionZonePair(); } - return interface->processReply( CalamaresUtils::Network::Manager::instance().synchronousGet( url ) ); + using namespace CalamaresUtils::Network; + return interface->processReply( + CalamaresUtils::Network::Manager::instance().synchronousGet( url, { RequestOptions::FakeUserAgent } ) ); } static QString @@ -125,7 +127,9 @@ do_raw_query( Handler::Type type, const QString& url, const QString& selector ) return QString(); } - return interface->rawReply( CalamaresUtils::Network::Manager::instance().synchronousGet( url ) ); + using namespace CalamaresUtils::Network; + return interface->rawReply( + CalamaresUtils::Network::Manager::instance().synchronousGet( url, { RequestOptions::FakeUserAgent } ) ); } RegionZonePair diff --git a/src/libcalamares/geoip/test_geoip.cpp b/src/libcalamares/geoip/test_geoip.cpp index 0c475b9c0..fd50cecff 100644 --- a/src/libcalamares/geoip/test_geoip.cpp +++ b/src/libcalamares/geoip/test_geoip.cpp @@ -11,7 +11,6 @@ * This is a test-application that does one GeoIP parse. */ -#include #include "GeoIPFixed.h" #include "GeoIPJSON.h" @@ -19,6 +18,10 @@ #include "GeoIPXML.h" #endif +#include "utils/Logger.h" + +#include + using std::cerr; using namespace CalamaresUtils::GeoIP; @@ -34,6 +37,9 @@ main( int argc, char** argv ) QString format( argv[ 1 ] ); QString selector = argc == 3 ? QString( argv[ 2 ] ) : QString(); + Logger::setupLogLevel(Logger::LOGVERBOSE); + cDebug() << "Doing GeoIP interpretation with format=" << format << "selector=" << selector; + Interface* handler = nullptr; if ( QStringLiteral( "json" ) == format ) { diff --git a/src/libcalamares/network/Manager.cpp b/src/libcalamares/network/Manager.cpp index 57faae28c..d089551bb 100644 --- a/src/libcalamares/network/Manager.cpp +++ b/src/libcalamares/network/Manager.cpp @@ -223,6 +223,7 @@ synchronousRun( QNetworkAccessManager* nam, const QUrl& url, const RequestOption auto* reply = asynchronousRun( nam, url, options ); if ( !reply ) { + cDebug() << "Could not create request for" << url; return qMakePair( RequestStatus( RequestStatus::Failed ), nullptr ); } @@ -232,10 +233,12 @@ synchronousRun( QNetworkAccessManager* nam, const QUrl& url, const RequestOption reply->deleteLater(); if ( reply->isRunning() ) { + cDebug() << "Timeout on request for" << url; return qMakePair( RequestStatus( RequestStatus::Timeout ), nullptr ); } else if ( reply->error() != QNetworkReply::NoError ) { + cDebug() << "HTTP error" << reply->error() << "on request for" << url; return qMakePair( RequestStatus( RequestStatus::HttpError ), nullptr ); } else