From: adam Date: Thu, 6 Jan 2005 23:41:48 +0000 (+0000) Subject: updated to use new util.Encode X-Git-Url: http://git.megacz.com/?p=org.ibex.net.git;a=commitdiff_plain;h=07da26d8a9a017bffb5c519a36da57d5df0fd439 updated to use new util.Encode darcs-hash:20050106234148-5007d-17e0fc0aa210017e0f3c28ba09d9c909d1ea0566.gz --- diff --git a/src/org/ibex/net/HTTP.java b/src/org/ibex/net/HTTP.java index ebdbf91..894a236 100644 --- a/src/org/ibex/net/HTTP.java +++ b/src/org/ibex/net/HTTP.java @@ -491,7 +491,7 @@ public class HTTP { if (h.get("AUTHTYPE").equals("Basic")) { if (authCache.get(originalUrl) != null) throw new HTTPException("username/password rejected"); - authCache.put(originalUrl, "Basic " + new String(Base64.encode(userInfo.getBytes("UTF8")))); + authCache.put(originalUrl, "Basic " + new String(Encode.toBase64(userInfo.getBytes("UTF8")))); } else if (h.get("AUTHTYPE").equals("Digest")) { if (authCache.get(originalUrl) != null && !"true".equals(h.get("stale"))) @@ -528,7 +528,7 @@ public class HTTP { if (style.equals("NTLM") && Proxy.Authorization.authorization2 == null) { Log.info(this, "Proxy identified itself as NTLM, sending Type 1 packet"); - Proxy.Authorization.authorization2 = "NTLM " + Base64.encode(Proxy.NTLM.type1); + Proxy.Authorization.authorization2 = "NTLM " + Encode.toBase64(Proxy.NTLM.type1); return; } /* @@ -538,7 +538,7 @@ public class HTTP { */ if (style.equals("Basic")) { Proxy.Authorization.authorization2 = - "Basic " + new String(Base64.encode(Proxy.Authorization.authorization.getBytes("UTF8"))); + "Basic " + new String(Encode.toBase64(Proxy.Authorization.authorization.getBytes("UTF8"))); } else if (style.equals("Digest")) { String A1 = Proxy.Authorization.authorization.substring(0, userInfo.indexOf(':')) + ":" + h.get("realm") + ":" + @@ -557,7 +557,7 @@ public class HTTP { } else if (style.equals("NTLM")) { Log.info(this, "Proxy identified itself as NTLM, got Type 2 packet"); - byte[] type2 = Base64.decode(((String)h0.get("proxy-authenticate")).substring(5).trim()); + byte[] type2 = Encode.fromBase64(((String)h0.get("proxy-authenticate")).substring(5).trim()); for(int i=0; i