Skip to content

Commit bf780c4

Browse files
Merge pull request cloudfoundry#1101 from cloudfoundry/dyna-polishing
Polishing Dynatrace Enhancement
2 parents e5c8eb3 + c0f13d5 commit bf780c4

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

lib/java_buildpack/framework/dynatrace_one_agent.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ def supports?
120120
:FILTER, :NETWORKZONE, :SKIP_ERRORS
121121

122122
def agent_download_url
123-
download_uri = "#{api_base_url(credentials)}/v1/deployment/installer/agent/unix/paas/latest?#{technologies(credentials)}" \
123+
download_uri = "#{api_base_url(credentials)}" \
124+
"/v1/deployment/installer/agent/unix/paas/latest?#{technologies(credentials)}" \
124125
'&bitness=64' \
125126
"&Api-Token=#{credentials[APITOKEN]}"
126127

@@ -130,13 +131,13 @@ def agent_download_url
130131
end
131132

132133
def technologies(credentials)
133-
code_modules = "include=java"
134-
if not credentials[ADDTECHNOLOGIES].empty?
135-
credentials[ADDTECHNOLOGIES].split(",").each do |tech|
134+
code_modules = 'include=java'
135+
if credentials.key?(ADDTECHNOLOGIES)
136+
credentials[ADDTECHNOLOGIES].split(',').each do |tech|
136137
code_modules += "&include=#{tech}"
137138
end
138139
end
139-
return code_modules
140+
code_modules
140141
end
141142

142143
def agent_manifest

lib/java_buildpack/util/sanitizer.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ def handle_params(params)
3636

3737
query_params = ''
3838

39-
params.split("&").each do |single_param|
40-
k, v = single_param.split("=")
41-
if k.match(keywords)
42-
v = "***"
43-
end
44-
query_params += k + '=' +v + '&'
39+
params.split('&').each do |single_param|
40+
k, v = single_param.split('=')
41+
v = '***' if k.match(keywords)
42+
query_params += k + '=' + v + '&'
4543
end
4644
query_params
4745
end

0 commit comments

Comments
 (0)