wasm: QNAM: support relative urls

We can pass these through to to the browser, which
will resolve them relative to the current html file.

Task-number: QTBUG-74289
Change-Id: I595f30456de55da4f1432fb997d381940f51c5f9
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
Morten Johan Sørvig 2019-03-06 13:38:35 +01:00
parent 4554fa7b19
commit cac487f051

View File

@ -1390,7 +1390,8 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
QString scheme = req.url().scheme();
#ifdef Q_OS_WASM
if (scheme == QLatin1String("http") || scheme == QLatin1String("https")) {
// Support http, https, and relateive urls
if (scheme == QLatin1String("http") || scheme == QLatin1String("https") || scheme.isEmpty()) {
QNetworkReplyWasmImpl *reply = new QNetworkReplyWasmImpl(this);
QNetworkReplyWasmImplPrivate *priv = reply->d_func();
priv->manager = this;