mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-15 18:21:35 +03:00
TokenCredentials: Don't overwrite Cookie header
If the request already had a cookie header, there was a reason for it. Don't blindly overwrite it.
This commit is contained in:
parent
acd3df33b6
commit
8cd1d43798
1 changed files with 4 additions and 1 deletions
|
@ -88,7 +88,10 @@ protected:
|
|||
QByteArray credHash = QByteArray(_cred->user().toUtf8()+":"+_cred->password().toUtf8()).toBase64();
|
||||
req.setRawHeader(QByteArray("Authorization"), QByteArray("Basic ") + credHash);
|
||||
|
||||
req.setRawHeader("Cookie", _cred->_token.toUtf8()); // analogous to neon in syncContextPreStart
|
||||
if (!req.hasRawHeader("Cookie")) {
|
||||
// Only use our token if the request doesn't have a cookie already (e.g. because of direct download URL)
|
||||
req.setRawHeader("Cookie", _cred->_token.toUtf8()); // analogous to neon in syncContextPreStart
|
||||
}
|
||||
|
||||
return MirallAccessManager::createRequest(op, req, outgoingData);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue