You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2018/12/16 21:42:38 UTC
[maven-wagon] branch master updated: [WAGON-540] Switch to
modern-day encoding (UTF-8) of auth credentials
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-wagon.git
The following commit(s) were added to refs/heads/master by this push:
new 49d058c [WAGON-540] Switch to modern-day encoding (UTF-8) of auth credentials
49d058c is described below
commit 49d058cd2578bb1c31c619b004e8f8192b7fb40b
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Nov 14 22:50:11 2018 +0100
[WAGON-540] Switch to modern-day encoding (UTF-8) of auth credentials
Unfortunately, no test can be added because Jetty's default
BasicAuthenticator uses ISO-8859-1 hardcoded and this cannot be changed.
Nexus uses Shiro which decodes as UTF-8 by default.
---
.../org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java b/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java
index 47f1794..5b909bb 100755
--- a/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java
+++ b/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java
@@ -93,6 +93,7 @@ import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
+import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
@@ -453,8 +454,8 @@ public abstract class AbstractHttpClientWagon
private static Registry<AuthSchemeProvider> createAuthSchemeRegistry()
{
return RegistryBuilder.<AuthSchemeProvider>create()
- .register( AuthSchemes.BASIC, new BasicSchemeFactory() )
- .register( AuthSchemes.DIGEST, new DigestSchemeFactory() )
+ .register( AuthSchemes.BASIC, new BasicSchemeFactory( StandardCharsets.UTF_8 ) )
+ .register( AuthSchemes.DIGEST, new DigestSchemeFactory( StandardCharsets.UTF_8 ) )
.register( AuthSchemes.NTLM, new NTLMSchemeFactory() )
.build();
}