Skip to content

Commit

Permalink
Merge pull request #35 from dlautz314/master
Browse files Browse the repository at this point in the history
converted HTTP network calls to more secure HTTPS network calls.
  • Loading branch information
vladest authored Mar 19, 2021
2 parents 54a357f + 456d1bf commit 8f7def1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions qgeotilefetchergooglemaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ QGeoTileFetcherGooglemaps::QGeoTileFetcherGooglemaps(const QVariantMap &paramete
m_apiKey = parameters.value(QStringLiteral("googlemaps.apikey")).toString();
m_signature = parameters.value(QStringLiteral("googlemaps.maps.signature")).toString();
m_client = parameters.value(QStringLiteral("googlemaps.maps.client")).toString();
m_baseUri = QStringLiteral("http://maps.googleapis.com/maps/api/staticmap");
m_baseUri = QStringLiteral("https://maps.googleapis.com/maps/api/staticmap");
if (parameters.contains(QStringLiteral("googlemaps.useragent")))
_userAgent = parameters.value(QStringLiteral("googlemaps.useragent")).toString().toLatin1();
else
Expand Down Expand Up @@ -122,31 +122,31 @@ QString QGeoTileFetcherGooglemaps::_getURL(int type, int x, int y, int zoom)
QString sec1 = ""; // after &x=...
QString sec2 = ""; // after &zoom=...
_getSecGoogleWords(x, y, sec1, sec2);
return QString("http://mt.google.com/vt/lyrs=m&hl=%1&x=%2%3&y=%4&z=%5&s=%6&scale=%7").arg(_language).arg(x).arg(sec1).arg(y).arg(zoom).arg(sec2).arg(_scale);
return QString("https://mt.google.com/vt/lyrs=m&hl=%1&x=%2%3&y=%4&z=%5&s=%6&scale=%7").arg(_language).arg(x).arg(sec1).arg(y).arg(zoom).arg(sec2).arg(_scale);
}
break;
case 2: //Satallite Map
{
QString sec1 = ""; // after &x=...
QString sec2 = ""; // after &zoom=...
_getSecGoogleWords(x, y, sec1, sec2);
return QString("http://mt.google.com/vt/lyrs=s&hl=%1&x=%2%3&y=%4&z=%5&s=%6&scale=%7").arg(_language).arg(x).arg(sec1).arg(y).arg(zoom).arg(sec2).arg(_scale);
return QString("https://mt.google.com/vt/lyrs=s&hl=%1&x=%2%3&y=%4&z=%5&s=%6&scale=%7").arg(_language).arg(x).arg(sec1).arg(y).arg(zoom).arg(sec2).arg(_scale);
}
break;
case 3: //Terrain Map
{
QString sec1 = ""; // after &x=...
QString sec2 = ""; // after &zoom=...
_getSecGoogleWords(x, y, sec1, sec2);
return QString("http://mt.google.com/vt/lyrs=p&hl=%1&x=%2%3&y=%4&z=%5&s=%6&scale=%7").arg(_language).arg(x).arg(sec1).arg(y).arg(zoom).arg(sec2).arg(_scale);
return QString("https://mt.google.com/vt/lyrs=p&hl=%1&x=%2%3&y=%4&z=%5&s=%6&scale=%7").arg(_language).arg(x).arg(sec1).arg(y).arg(zoom).arg(sec2).arg(_scale);
}
break;
case 4: //Hybrid Map
{
QString sec1 = ""; // after &x=...
QString sec2 = ""; // after &zoom=...
_getSecGoogleWords(x, y, sec1, sec2);
return QString("http://mt.google.com/vt/lyrs=y&hl=%1&x=%2%3&y=%4&z=%5&s=%6&scale=%7").arg(_language).arg(x).arg(sec1).arg(y).arg(zoom).arg(sec2).arg(_scale);
return QString("https://mt.google.com/vt/lyrs=y&hl=%1&x=%2%3&y=%4&z=%5&s=%6&scale=%7").arg(_language).arg(x).arg(sec1).arg(y).arg(zoom).arg(sec2).arg(_scale);
}
break;
}
Expand Down Expand Up @@ -198,7 +198,7 @@ void QGeoTileFetcherGooglemaps::_tryCorrectGoogleVersions(QNetworkAccessManager*
conf.setPeerVerifyMode(QSslSocket::VerifyNone);
qheader.setSslConfiguration(conf);
#endif
QString url = "http://maps.google.com/maps/api/js?v=3.2&sensor=false";
QString url = "https://maps.google.com/maps/api/js?v=3.2&sensor=false";
qheader.setUrl(QUrl(url));
qheader.setRawHeader("User-Agent", _userAgent);
_googleReply = networkManager->get(qheader);
Expand Down
2 changes: 1 addition & 1 deletion qplacemanagerenginegooglemaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace
{
QString SpecialPhrasesBaseUrl = QStringLiteral("http://wiki.openstreetmap.org/wiki/Special:Export/Nominatim/Special_Phrases/");
QString SpecialPhrasesBaseUrl = QStringLiteral("https://wiki.openstreetmap.org/wiki/Special:Export/Nominatim/Special_Phrases/");

QString nameForTagKey(const QString &tagKey)
{
Expand Down

0 comments on commit 8f7def1

Please sign in to comment.