Fix character encoding for basic authentication (#2038)

Regarding to RFC 7617 (see
https://datatracker.ietf.org/doc/html/rfc7617), the default
encoding for basic auth strings should be UTF-8.
This commit is contained in:
René Pfeuffer
2022-05-18 09:44:38 +02:00
committed by GitHub
parent 9bfb074805
commit 256106545d
3 changed files with 4 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
- type: fixed
description: character encoding for basic authentication ([#2038](https://github.com/scm-manager/scm-manager/pull/2038))

View File

@@ -264,7 +264,7 @@ public final class UserAgent
private boolean scmClient = false;
/** basic authentication charset */
private Charset basicAuthenticationCharset = StandardCharsets.ISO_8859_1;
private Charset basicAuthenticationCharset = StandardCharsets.UTF_8;
}

View File

@@ -88,7 +88,7 @@ public class UserAgentParserTest
{
UserAgent ua = parser.parse(UA_1);
assertEquals(Charsets.ISO_8859_1, ua.getBasicAuthenticationCharset());
assertEquals(Charsets.UTF_8, ua.getBasicAuthenticationCharset());
assertFalse(ua.isBrowser());
}