Fix a bug in digest auth generator function

This commit is contained in:
Shweelan Samson authored and Zaid Abdulla committed 2019-06-05 00:17:36 -07:00
1 parent 83dba52e96
commit e26fffa761
1 file changed
+8 -1
+8 -1
View File
@@ -109,7 +109,14 @@ export function digest(
.update(httpMethod) .update(httpMethod)
.update(":") .update(":")
.update(uri); .update(uri);
if (qop === "auth-int") ha2.update(":").update(body);
if (qop === "auth-int") {
const bodyHash = createHash("md5")
.update(body)
.digest("hex");
ha2.update(":").update(bodyHash);
}
const ha2d = ha2.digest("hex"); const ha2d = ha2.digest("hex");
const hash = createHash("md5"); const hash = createHash("md5");