BUG!!! -- JDK1.3.1_01+ causes URLConnection.setRequestProperty error

This is a very specific bug. It is only revealed when using the BASE64Encoder in conjunction with the setRequestProperty method of the URLConnection class.

In JDK1.3.1_01+, code that worked fine in JDK1.2.2 and JDK1.3.0 throws the error:

"java.lang.IllegalArgumentException: Illegal character(s) in message header value: Basic <encrypted string>"

The code used was:

--

String User = "Username:Password";

BASE64Encoder encoder = new BASE64Encoder();

String encoding = new String(encoder.encodeBuffer(User.getBytes()));

URLConnection uc = url.openConnection();

uc.setRequestProperty("Authorization", "Basic " + encoding);

--

Without the ability to send 64bit encrypted data to a web server as a header, any URL that requires basic authentication is unretrievable.

[847 byte] By [KHeston] at [2008-1-25]
# 1
Have you been able to resovle this issue yet? Oh sorry, have you found any resolution to this issue? I did narrow this from working in JDK 1.3.002 to not working in JDK 1.3.003. Yes you are my hero!
fraze4 at 2007-7-1 > top of java,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...