Skip to content

Commit

Permalink
Merge pull request square#2499 from square/dr-Apr212016-redact-async-url
Browse files Browse the repository at this point in the history
Redact the full url in AsyncCall thread name.
  • Loading branch information
swankjesse committed Apr 21, 2016
2 parents b26ad3e + 047b568 commit 14cb6e3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions okhttp/src/main/java/okhttp3/RealCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ final class AsyncCall extends NamedRunnable {
private final boolean forWebSocket;

private AsyncCall(Callback responseCallback, boolean forWebSocket) {
super("OkHttp %s", originalRequest.url().toString());
super("OkHttp %s", redactedUrl().toString());
this.responseCallback = responseCallback;
this.forWebSocket = forWebSocket;
}
Expand Down Expand Up @@ -151,8 +151,11 @@ RealCall get() {
*/
private String toLoggableString() {
String string = canceled ? "canceled call" : "call";
HttpUrl redactedUrl = originalRequest.url().resolve("/...");
return string + " to " + redactedUrl;
return string + " to " + redactedUrl();
}

HttpUrl redactedUrl() {
return originalRequest.url().resolve("/...");
}

private Response getResponseWithInterceptorChain(boolean forWebSocket) throws IOException {
Expand Down

0 comments on commit 14cb6e3

Please sign in to comment.