mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 20:01:28 +00:00
fix: improve parsing of authentication details in digest interceptor
This commit is contained in:
@@ -45,9 +45,15 @@ function addDigestInterceptor(axiosInstance, request) {
|
||||
console.debug(error.response.headers['www-authenticate']);
|
||||
|
||||
const authDetails = error.response.headers['www-authenticate']
|
||||
.split(', ')
|
||||
.map((v) => v.split('=').map(stripQuotes))
|
||||
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {});
|
||||
.split(',')
|
||||
.map((pair) => pair.split('=').map((item) => item.trim()).map(stripQuotes))
|
||||
.reduce((acc, [key, value]) => {
|
||||
if (key && value !== undefined) {
|
||||
acc[key] = value;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
console.debug(authDetails);
|
||||
|
||||
const nonceCount = '00000001';
|
||||
|
||||
Reference in New Issue
Block a user