Bug 1957050 - [bidi] Avoid infinite loop in NetworkDecodedBodySizeMap for authentication chains without redirects r=webdriver-reviewers,whimboo

When network.auth.use_redirect_for_retries is false, all authentication channels use the same channel id.
There is no need to update the internal authentication mapping in this case.

Differential Revision: https://phabricator.services.mozilla.com/D243807
This commit is contained in:
Julian Descottes
2025-04-02 12:05:55 +00:00
parent 02309ca009
commit 83c71127c8

View File

@@ -40,6 +40,13 @@ export class NetworkDecodedBodySizeMap {
* The channel ID of the new channel in the authentication chain.
*/
setAuthenticationAttemptMapping(previousChannelId, nextChannelId) {
if (previousChannelId === nextChannelId) {
// If the preference network.auth.use_redirect_for_retries is set to false
// all channels in the authentication chain will share the same channelId.
// In this case there is no need to set anything in the map, the content
// size will be set for the correct channelId by design.
return;
}
this.#authenticationAttemptsMap.set(previousChannelId, nextChannelId);
}