Changeset 10308 in josm for trunk/src/org/openstreetmap/josm/io/OsmConnection.java
- Timestamp:
- 2016-06-01T23:17:40+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r10237 r10308 11 11 import java.nio.CharBuffer; 12 12 import java.nio.charset.CharacterCodingException; 13 import java.nio.charset.CharsetEncoder;14 13 import java.nio.charset.StandardCharsets; 15 14 import java.util.Objects; … … 63 62 */ 64 63 protected void addBasicAuthorizationHeader(HttpClient con) throws OsmTransferException { 65 CharsetEncoder encoder = StandardCharsets.UTF_8.newEncoder();66 64 CredentialsAgentResponse response; 67 String token;68 65 try { 69 66 synchronized (CredentialsManager.getInstance()) { … … 74 71 throw new OsmTransferException(e); 75 72 } 73 String token; 76 74 if (response == null) { 77 75 token = ":"; … … 84 82 token = username + ':' + password; 85 83 try { 86 ByteBuffer bytes = encoder.encode(CharBuffer.wrap(token));84 ByteBuffer bytes = StandardCharsets.UTF_8.newEncoder().encode(CharBuffer.wrap(token)); 87 85 con.setHeader("Authorization", "Basic "+Base64.encode(bytes)); 88 86 } catch (CharacterCodingException e) {
Note:
See TracChangeset
for help on using the changeset viewer.