- Timestamp:
- 2022-03-22T17:10:25+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r18332 r18407 126 126 127 127 /** 128 * Removed privacy related parts form output URL 129 * @param url Unmodified URL 130 * @return Stripped URL (privacy related issues removed) 131 */ 132 private String stripUrl(URL url) { 133 return url.toString().replaceAll("(token|key|connectId)=[^&]+","$1=...stripped..."); 134 } 135 136 /** 128 137 * Opens the HTTP connection. 129 138 * @param progressMonitor progress monitor … … 149 158 final boolean hasReason = !Utils.isEmpty(reasonForRequest); 150 159 logRequest("{0} {1}{2} -> {3} {4} ({5}{6})", 151 getRequestMethod(), getURL(), hasReason ? (" (" + reasonForRequest + ')') : "",160 getRequestMethod(), stripUrl(getURL()), hasReason ? (" (" + reasonForRequest + ')') : "", 152 161 cr.getResponseVersion(), cr.getResponseCode(), 153 162 stopwatch, … … 167 176 } 168 177 } catch (IOException | RuntimeException e) { 169 logRequest("{0} {1} -> !!! ({2})", requestMethod, url, stopwatch);178 logRequest("{0} {1} -> !!! ({2})", requestMethod, stripUrl(url), stopwatch); 170 179 Logging.warn(e); 171 180 //noinspection ThrowableResultOfMethodCallIgnored
Note:
See TracChangeset
for help on using the changeset viewer.