Changeset 14496 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-12-02T18:35:04+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java
r14298 r14496 2011 2011 */ 2012 2012 // Needed by UrlValidator 2013 static String unicodeToASCII(String input) {2013 public static String unicodeToASCII(String input) { 2014 2014 if (isOnlyASCII(input)) { // skip possibly expensive processing 2015 2015 return input; -
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.