- Timestamp:
- 2022-04-27T21:26:39+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r18409 r18437 189 189 " Can''t redirect. Aborting.", cr.getResponseCode())); 190 190 } else if (maxRedirects > 0) { 191 final URL oldUrl = url; 191 192 url = new URL(url, redirectLocation); 192 193 maxRedirects--; 193 194 logRequest(tr("Download redirected to ''{0}''", redirectLocation)); 195 // Fix JOSM #21935: Avoid leaking `Authorization` header on redirects. 196 if (!Objects.equals(oldUrl.getHost(), this.url.getHost()) && this.getRequestHeader("Authorization") != null) { 197 logRequest(tr("Download redirected to different host (''{0}'' -> ''{1}''), removing authorization headers", 198 oldUrl.getHost(), url.getHost())); 199 this.headers.remove("Authorization"); 200 } 194 201 response = connect(); 195 202 successfulConnection = true;
Note:
See TracChangeset
for help on using the changeset viewer.