jersey
jersey copied to clipboard
Base64 encoding with non ASCII characters results in ArrayIndexOutOfBoundException
To calculate the authentication string in org.glassfish.jersey.client.authentication.BasicAuthenticator the method org.glassfish.jersey.internal.util.Base64.encodeAsString() is used to do the Base64 encoding. Unfortunately this results in a ArrayIndexOutOfBoundException when the password contains non ASCII characters like § (the paragraph sign) or a German Umlaut.
Some examples:
- Base64.encodeAsString(new byte[]{(byte)128})
- Base64.encodeAsString("§")