node-http-digest-client
node-http-digest-client copied to clipboard
Failure when server response header is not valid
Hey,
I'm using your module and when tried to make a request I got an exception:
TypeError: Cannot read property 'length' of null
at parseChallenge [as _parseChallenge] /home/yeudit/workspace/att/breeze/System/core/node_modules/http-digest-client/http-digest-client.js:112:15
at handleResponse [as _handleResponse] /home/yeudit/workspace/att/breeze/System/core/node_modules/http-digest-client/http-digest-client.js:40:26
at ClientRequest.
the response header was: Digest nonce="907419fb8e9c9d12e1270a7b7117b74c", opaque="510ed2366f84e2e3b5dcd95df026cdde", realm="[email protected]", qop=auth
and the failure was because of the 'qop' parameter https://github.com/simme/node-http-digest-client/blob/master/http-digest-client.js#L106
how can I prevent this failure? or maybe you have to add a fix?
Thanks
A bit late to the party, but changing that line to if (part && part.length > 2) {
solved it for me.