diff --git a/lib/java_buildpack/util/sanitizer.rb b/lib/java_buildpack/util/sanitizer.rb index eafb4729b7..6f1f5de2df 100644 --- a/lib/java_buildpack/util/sanitizer.rb +++ b/lib/java_buildpack/util/sanitizer.rb @@ -36,17 +36,8 @@ def handle_params(params) query_params = '' - params.each do |key, value| - match = key.match(keywords) - - if match - params[key] = if match[0] == 'Api-Token' && value =~ /dt\w*/ - value.gsub(/(dt\w*\.\w*)\.\w*/, '\1.REDACTED') - else - '***' - end - end - + params.each do |key, _| + params[key] = '***' if key.match(keywords) query_params += key + '=' + params[key] + '&' end diff --git a/spec/java_buildpack/util/sanitize_spec.rb b/spec/java_buildpack/util/sanitize_spec.rb index 59609ea91d..f7c929a48f 100644 --- a/spec/java_buildpack/util/sanitize_spec.rb +++ b/spec/java_buildpack/util/sanitize_spec.rb @@ -37,7 +37,7 @@ '&password=***'\ '&include=java'\ '&bitness=64'\ - '&Api-Token=dt0c01.H67ALCXCXK7PWAAOQLENSRET.REDACTED'\ + '&Api-Token=***'\ '&secret-token=***'\ '&token=***') end