inorganik / digest-auth-request

Make digest-auth requests with vanilla javascript
MIT License
70 stars 49 forks source link

Fix header matching #40

Open tijmenNL opened 5 years ago

tijmenNL commented 5 years ago

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.