In electron 3.1.12 it turned out the header access-control-expose-headers: www-authenticate is also present when you do getAllResponseHeaders(). It comes later then the www-authenticate: digest.. so it is matched inside the for loop, hence the values from the header can't be parsed.
Besides the improved matching, which ensures the right header, we can also break out of the loop if we found the match as there is no need to look further.
In electron 3.1.12 it turned out the header
access-control-expose-headers: www-authenticate
is also present when you dogetAllResponseHeaders()
. It comes later then thewww-authenticate: digest..
so it is matched inside the for loop, hence the values from the header can't be parsed.Besides the improved matching, which ensures the right header, we can also break out of the loop if we found the match as there is no need to look further.