Bug 137852 - Add a new working HTTP authentication identity to the begining of the session cache list. r=honzab

This commit is contained in:
Andrea Bartolucci 2016-01-21 11:22:00 +01:00
Родитель f7eb24a6ab
Коммит 7155453855
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -580,7 +580,11 @@ nsHttpAuthNode::SetAuthEntry(const char *path,
entry = new nsHttpAuthEntry(path, realm, creds, challenge, ident, metadata);
if (!entry)
return NS_ERROR_OUT_OF_MEMORY;
mList.AppendElement(entry);
// We want the latest identity be at the begining of the list so that
// the newest working credentials are sent first on new requests.
// Changing a realm is sometimes used to "timeout" authrozization.
mList.InsertElementAt(0, entry);
}
else {
// update the entry...