Velo Hero: Use HTTP with TLS and custom User-Agent (#3885)

This commit is contained in:
Nils
2021-05-08 23:07:49 +02:00
committed by GitHub
parent ac606065aa
commit 3e153f03ac
2 changed files with 4 additions and 2 deletions

View File

@@ -48,7 +48,7 @@
* - so... hack around this with currentRequest + dispatchRequest TODO: fix
*/
const QString VELOHERO_URL( "http://app.velohero.com" );
const QString VELOHERO_URL( "https://app.velohero.com" );
class VeloHeroParser : public QXmlDefaultHandler
{

View File

@@ -51,7 +51,7 @@
} while(0)
#endif
static const QString VELOHERO_URL( "http://app.velohero.com" );
static const QString VELOHERO_URL( "https://app.velohero.com" );
Velohero::Velohero(Context *context) : CloudService(context), context(context), root_(NULL) {
@@ -99,6 +99,7 @@ Velohero::open(QStringList &errors)
request.setRawHeader("Accept-Encoding", "identity");
request.setRawHeader("Accept", "application/xml");
request.setRawHeader("Accept-Charset", "utf-8");
request.setRawHeader("User-Agent", "GoldenCheetah/1.0");
QEventLoop loop;
reply = nam->get(request);
@@ -179,6 +180,7 @@ Velohero::writeFile(QByteArray &data, QString remotename, RideFile *ride)
request.setRawHeader( "Accept-Encoding", "identity" );
request.setRawHeader( "Accept", "application/xml" );
request.setRawHeader( "Accept-Charset", "utf-8" );
request.setRawHeader( "User-Agent", "GoldenCheetah/1.0" );
// this must be performed asyncronously and call made
// to notifyWriteCompleted(QString remotename, QString message) when done