diff options
| author | Lorn Potter <lorn.potter@gmail.com> | 2022-09-07 11:56:54 +1000 |
|---|---|---|
| committer | Lorn Potter <lorn.potter@gmail.com> | 2022-09-28 11:34:00 +1000 |
| commit | 2efd2f490c1620343447198dc27e0340e4e670f6 (patch) | |
| tree | 27b77d86eea55f90b512e095aadaec4575b6dc0a /src/network/access/qnetworkreplywasmimpl.cpp | |
| parent | 77646f668da94ebc7afa683527181c5e3ba3c8b0 (diff) | |
wasm: allow useCredentials access control to be set
Introduce UseCredentialsAttribute that indicates whether
the underlying fetch/XMLHttpRequest should use credentials
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials
Fixes: QTBUG-90893
Change-Id: I2c43e286db52df387c0a22737d027b9a2a8dd2d3
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/access/qnetworkreplywasmimpl.cpp')
| -rw-r--r-- | src/network/access/qnetworkreplywasmimpl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp index 2e0f865ccb6..9ed01d06ce3 100644 --- a/src/network/access/qnetworkreplywasmimpl.cpp +++ b/src/network/access/qnetworkreplywasmimpl.cpp @@ -223,6 +223,9 @@ 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.onsuccess = QNetworkReplyWasmImplPrivate::downloadSucceeded; attr.onerror = QNetworkReplyWasmImplPrivate::downloadFailed; |
