summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCajus Pollmeier <[email protected]>2023-03-31 14:26:09 +0200
committerCajus Pollmeier <[email protected]>2023-04-04 13:41:06 +0200
commit59466abc080419465606240a02d333aac9b712ce (patch)
tree9fd8ed803cc1e9cbeeefe8b64aa141ae8db71e0c
parentda2b0307f8dd563be5874cabe3290c073365f761 (diff)
Fix default "credential" flag for WASM HTTP connections
In some cases, you might want to set the "credentials" flag for HTTP requests. But you can't use it everywhere, because it may break the use of public APIs. As a result, you're running into Reason: Credential is not supported if the CORS header 'Access-Control-Allow-Origin' is '*' on the client side. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSNotSupportingCredentials for details. This commit restores the former default "false", in order to make WASM connections that worked prior 6.5 work again. Fixes: QTBUG-112478 Pick-to: 6.5 Change-Id: I46f6a374c07038608c3484ac831a1dc5999fb120 Reviewed-by: MikoĊ‚aj Boc <[email protected]> Reviewed-by: Lorn Potter <[email protected]>
-rw-r--r--src/network/access/qnetworkreplywasmimpl.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp
index b7fec9345af..d567423499e 100644
--- a/src/network/access/qnetworkreplywasmimpl.cpp
+++ b/src/network/access/qnetworkreplywasmimpl.cpp
@@ -282,10 +282,8 @@ void QNetworkReplyWasmImplPrivate::doSendRequest()
request.attribute(QNetworkRequest::CacheSaveControlAttribute, false).toBool()) {
attr.attributes -= EMSCRIPTEN_FETCH_PERSIST_FILE;
}
- if (request.attribute(QNetworkRequest::UseCredentialsAttribute, true).toBool()) {
- attr.withCredentials = true;
- }
+ attr.withCredentials = request.attribute(QNetworkRequest::UseCredentialsAttribute, false).toBool();
attr.onsuccess = QNetworkReplyWasmImplPrivate::downloadSucceeded;
attr.onerror = QNetworkReplyWasmImplPrivate::downloadFailed;
attr.onprogress = QNetworkReplyWasmImplPrivate::downloadProgress;