Fix DefaultCharset bug pattern flagged by error prone
See more details in: [1]. [1] https://errorprone.info/bugpattern/DefaultCharset Change-Id: Ib6aa279f9dcf63dff0672df5b5be3ea72597b1d8
This commit is contained in:
parent
6672bacca4
commit
b6b1e0a0ad
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
package org.eclipse.jgit.transport;
|
package org.eclipse.jgit.transport;
|
||||||
|
|
||||||
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
@ -145,7 +147,7 @@ public static void sign(HttpURLConnection httpURLConnection,
|
||||||
canonicalRequest.getBytes(StandardCharsets.UTF_8)));
|
canonicalRequest.getBytes(StandardCharsets.UTF_8)));
|
||||||
|
|
||||||
// compute the signing key
|
// compute the signing key
|
||||||
byte[] secretKey = (SCHEME + new String(awsSecretKey)).getBytes();
|
byte[] secretKey = (SCHEME + new String(awsSecretKey)).getBytes(UTF_8);
|
||||||
byte[] dateKey = signStringWithKey(scopeDate, secretKey);
|
byte[] dateKey = signStringWithKey(scopeDate, secretKey);
|
||||||
byte[] regionKey = signStringWithKey(regionName, dateKey);
|
byte[] regionKey = signStringWithKey(regionName, dateKey);
|
||||||
byte[] serviceKey = signStringWithKey(serviceName, regionKey);
|
byte[] serviceKey = signStringWithKey(serviceName, regionKey);
|
||||||
|
|
Loading…
Reference in New Issue