Closed Ali-Nass closed 3 years ago
I was able to make it work by configuring my own axios instance with keep connection alive
const httpsAgent = new https.Agent({ keepAlive: true });
const httpAgent = new https.Agent({ keepAlive: true });
const axiosInstance = axios.create({
httpsAgent,
httpAgent,
});
and then pass this instance to the library
const digestAuth = new AxiosDigestAuth({
username,
password,
axios: axiosInstance,
});
and now it's working like a charm!
I'm trying to apply a simple scenario like the following:
Is there anything I'm missing to add?
I'm getting the following in the logs:
"headers":{"Accept":"application/json","Content-Type":"application/x-www-form-urlencoded","authorization":"Digest username=\"user\",realm=\"Something\",nonce=\"F0WPyO/ckHwF7KbJIXQ4yWxhav/0jw9v\",uri=\"uri",qop=\"auth\",algorithm=\"MD5\",response=\"8f84c8e1cdcf177bf74304b3d52675aa\",nc=\"00000001\",cnonce=\"17ff0f091b3949da7911654890914a55a380f2ff57a1ca13\"","User-Agent":"axios/0.21.1","Content-Length":77,"x-datadog-trace-id":"385142050296865726","x-datadog-parent-id":"2471136348259650736","x-datadog-sampled":"1","x-datadog-sampling-priority":"1"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1}}