Ticket #8606: 8606.patch
| File 8606.patch, 1.9 KB (added by , 13 years ago) |
|---|
-
src/org/openstreetmap/josm/data/Version.java
226 226 } 227 227 return "JOSM/1.5 ("+ s+" "+LanguageInfo.getJOSMLocaleCode()+") " + Main.platform.getOSDescription(); 228 228 } 229 230 /** 231 * Returns the full User-Agent string 232 * @return The User-Agent 233 * @since 5866 234 */ 235 public String getFullAgentString() { 236 return getAgentString + " Java/"+System.getProperty("java.version"); 237 } 229 238 } -
src/org/openstreetmap/josm/io/imagery/WMSGrabber.java
50 50 if(layer.getInfo().getCookies() != null && !layer.getInfo().getCookies().equals("")) { 51 51 props.put("Cookie", layer.getInfo().getCookies()); 52 52 } 53 props.put("User-Agent", Version.getInstance().getFullAgentString())); 53 54 Pattern pattern = Pattern.compile("\\{header\\(([^,]+),([^}]+)\\)\\}"); 54 55 StringBuffer output = new StringBuffer(); 55 56 Matcher matcher = pattern.matcher(this.baseURL); -
src/org/openstreetmap/josm/tools/Utils.java
553 553 throw new IllegalArgumentException("Invalid HTTP url"); 554 554 } 555 555 HttpURLConnection connection = (HttpURLConnection) httpURL.openConnection(); 556 connection.setRequestProperty("User-Agent", Version.getInstance().getFullAgentString())); 556 557 return connection; 557 558 } 558 559
