Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Mask the Authorization header
Address issue JENKINS-39744 by always masking the “Authorization” header value.
  • Loading branch information
Lexmark-haputman committed Nov 15, 2016
1 parent e3e4824 commit 8865521
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/jenkins/plugins/http_request/HttpRequest.java
Expand Up @@ -269,7 +269,11 @@ public ResponseContentSupplier performHttpRequest(TaskListener listener, Request
logger.println("HttpMode: " + requestAction.getMode());
logger.println(String.format("URL: %s", requestAction.getUrl()));
for (HttpRequestNameValuePair header : requestAction.getHeaders()) {
logger.println(header.getName() + ": " + header.getValue());
if (header.getName().equalsIgnoreCase("Authorization")) {
logger.println(header.getName() + ": *****");
} else {
logger.println(header.getName() + ": " + header.getValue());
}
}

DefaultHttpClient httpclient = new SystemDefaultHttpClient();
Expand Down

0 comments on commit 8865521

Please sign in to comment.