Changeset 14496 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2018-12-02T18:35:04+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r14214 r14496 13 13 import java.net.CookieManager; 14 14 import java.net.HttpURLConnection; 15 import java.net.MalformedURLException; 15 16 import java.net.URL; 16 17 import java.nio.charset.StandardCharsets; … … 30 31 31 32 import org.openstreetmap.josm.data.Version; 33 import org.openstreetmap.josm.data.validation.routines.DomainValidator; 32 34 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 33 35 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 78 80 79 81 private HttpClient(URL url, String requestMethod) { 80 this.url = url; 82 try { 83 String host = url.getHost(); 84 String asciiHost = DomainValidator.unicodeToASCII(host); 85 this.url = asciiHost.equals(host) ? url : new URL(url.getProtocol(), asciiHost, url.getPort(), url.getFile()); 86 } catch (MalformedURLException e) { 87 throw new JosmRuntimeException(e); 88 } 81 89 this.requestMethod = requestMethod; 82 90 this.headers.put("Accept-Encoding", "gzip");
Note:
See TracChangeset
for help on using the changeset viewer.