@@ -53,10 +53,6 @@ private static String computeBasicAuthentication(String principal, String passwo
5353return "Basic " +Base64 .encode (s .getBytes (charset ));
5454 }
5555
56- public static String computeRealmURI (Realm realm ) {
57- return computeRealmURI (realm .getUri (),realm .isUseAbsoluteURI (),realm .isOmitQuery ());
58- }
59-
6056public static String computeRealmURI (Uri uri ,boolean useAbsoluteURI ,boolean omitQuery ) {
6157if (useAbsoluteURI ) {
6258return omitQuery &&MiscUtils .isNonEmpty (uri .getQuery ()) ?uri .withNewQuery (null ).toUrl () :uri .toUrl ();
@@ -67,12 +63,14 @@ public static String computeRealmURI(Uri uri, boolean useAbsoluteURI, boolean om
6763 }
6864
6965private static String computeDigestAuthentication (Realm realm ) {
66+
67+ String realmUri =computeRealmURI (realm .getUri (),realm .isUseAbsoluteURI (),realm .isOmitQuery ());
7068
7169StringBuilder builder =new StringBuilder ().append ("Digest " );
7270append (builder ,"username" ,realm .getPrincipal (),true );
7371append (builder ,"realm" ,realm .getRealmName (),true );
7472append (builder ,"nonce" ,realm .getNonce (),true );
75- append (builder ,"uri" ,computeRealmURI ( realm ) ,true );
73+ append (builder ,"uri" ,realmUri ,true );
7674if (isNonEmpty (realm .getAlgorithm ()))
7775append (builder ,"algorithm" ,realm .getAlgorithm (),false );
7876