Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Commit

Permalink
Use StandardCharsets.UTF_8 instead of hard-coding "UTF-8".
Browse files Browse the repository at this point in the history
  • Loading branch information
huadong committed Dec 12, 2017
1 parent 137402f commit 4f5b8c1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
import java.net.SocketTimeoutException;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down Expand Up @@ -2751,8 +2752,8 @@ private String authRegistryHeader(final RegistryConfigs registryConfigs)
authRegistryJson = "{\"auths\":" + authRegistryJson + "}";
}

return Base64.encodeBase64String(authRegistryJson.getBytes("UTF-8"));
} catch (JsonProcessingException | InterruptedException | UnsupportedEncodingException ex) {
return Base64.encodeBase64String(authRegistryJson.getBytes(StandardCharsets.UTF_8));
} catch (JsonProcessingException | InterruptedException ex) {
throw new DockerException("Could not encode X-Registry-Config header", ex);
}
}
Expand Down

0 comments on commit 4f5b8c1

Please sign in to comment.