mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-06 02:16:55 +02:00
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:
2
gradle/changelog/basic_auth.yaml
Normal file
2
gradle/changelog/basic_auth.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
- type: fixed
|
||||
description: character encoding for basic authentication ([#2038](https://github.com/scm-manager/scm-manager/pull/2038))
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user