}
String authscheme = auth.substring(0, i);
if (authscheme.equalsIgnoreCase("basic")) {
String s = auth.substring(i + 1).trim();
byte[] credsRaw = s.getBytes(HTTP.ASCII);
BinaryDecoder codec = new Base64();
try {
String creds = new String(codec.decode(credsRaw), HTTP.ASCII);
context.setAttribute("proxy-creds", creds);
} catch (DecoderException ex) {
throw new ProtocolException("Malformed BASIC credentials");
}
}