Commit 0e6edfb4 authored by Greg Messner's avatar Greg Messner
Browse files

Added maskPrivateToken() method.

parent f6833a4b
...@@ -144,4 +144,19 @@ public class HttpRequestUtils { ...@@ -144,4 +144,19 @@ public class HttpRequestUtils {
return (out.toString()); return (out.toString());
} }
/**
* Masks the PRIVATE-TOKEN header value with "********".
*
* @param s a String containing HTTP request info, usually logging info
* @return a String with the PRIVATE-TOKEN header value masked with asterisks
*/
public static String maskPrivateToken(String s) {
if (s == null || s.isEmpty()) {
return (s);
}
return (s.replaceAll("PRIVATE\\-TOKEN\\: [\\S]*", "PRIVATE-TOKEN: ********"));
}
} }
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment