private void newResponse(MessageDigest md) { // when using preemptive auth, the request uri is missing if (uri != null) { // BEWARE: compute first as it uses the cached StringBuilder String digestUri = AuthenticatorUtils.computeRealmURI(uri, useAbsoluteURI, omitQuery); StringBuilder sb = StringBuilderPool.DEFAULT.stringBuilder(); // WARNING: DON'T MOVE, BUFFER IS RECYCLED!!!! byte[] ha1 = ha1(sb, md); byte[] ha2 = ha2(sb, digestUri, md); appendBase16(sb, ha1); appendMiddlePart(sb); appendBase16(sb, ha2); byte[] responseDigest = md5FromRecycledStringBuilder(sb, md); response = toHexString(responseDigest); } }