Skip to content
Browse files

Merge pull request #87 from iLanguage/master

Tiny patch which removes username and password from the logs
  • Loading branch information...
2 parents 59ddf37 + 39431f3 commit 04333b20de7b820d8b0e5b94db54657270b96ff7 @jchris jchris committed Mar 1, 2013
View
4 TouchDB-Android/src/com/couchbase/touchdb/replicator/TDReplicator.java
@@ -105,7 +105,9 @@ public void databaseClosing() {
}
public String toString() {
- String name = getClass().getSimpleName() + "[" + (remote != null ? remote.toExternalForm() : "") + "]";
+ String maskedRemoteWithoutCredentials = (remote != null ? remote.toExternalForm() : "");
+ maskedRemoteWithoutCredentials = maskedRemoteWithoutCredentials.replaceAll("://.*:.*@","://---:---@");
+ String name = getClass().getSimpleName() + "[" + maskedRemoteWithoutCredentials + "]";
return name;
}
View
4 TouchDB-Android/src/com/couchbase/touchdb/replicator/changetracker/TDChangeTracker.java
@@ -186,7 +186,9 @@ public void process(HttpRequest request,
}
try {
- Log.v(TDDatabase.TAG, "Making request to " + getChangesFeedURL().toString());
+ String maskedRemoteWithoutCredentials = getChangesFeedURL().toString();
+ maskedRemoteWithoutCredentials = maskedRemoteWithoutCredentials.replaceAll("://.*:.*@","://---:---@");
+ Log.v(TDDatabase.TAG, "Making request to " + maskedRemoteWithoutCredentials);
HttpResponse response = httpClient.execute(request);
StatusLine status = response.getStatusLine();
if(status.getStatusCode() >= 300) {

0 comments on commit 04333b2

Please sign in to comment.
Something went wrong with that request. Please try again.