You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some browsers and also Java client send basic authentication headers with ISO-1 encoding. Other browser send it with UTF-8. Here is a patch to solve this. It try first an UTF-8 encoding and if this failing then use ISO-1 encoding.
- final String usernamePassword = new String(authorizationHeader.getTokenBytes(), Charsets.UTF_8);
+ byte[] tokenBytes = authorizationHeader.getTokenBytes();
+ String usernamePassword = new String(tokenBytes, Charsets.UTF_8);
+ if( usernamePassword.contains( "\ufffd" ) ) {
+ // if UTF-8 converting failing use ISO_8859_1
+ // Chrome use UTF-8, Java use ISO-1, IE and FF use ISO or platform default like CP1252
+ usernamePassword = new String(tokenBytes, Charsets.ISO_8859_1);
+ }
The text was updated successfully, but these errors were encountered:
Some browsers and also Java client send basic authentication headers with ISO-1 encoding. Other browser send it with UTF-8. Here is a patch to solve this. It try first an UTF-8 encoding and if this failing then use ISO-1 encoding.
The text was updated successfully, but these errors were encountered: