Skip to content

Commit d6a48b9

Browse files
authored
Merge pull request Netflix-Skunkworks#250 from Netflix-Skunkworks/bugfix/vuln-views
fixed partial and added new matcher
2 parents b2dcd9e + 6a4b046 commit d6a48b9

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

app/views/results/metadata/_vulnerability.html.erb

+20-2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
</dl>
144144
</div>
145145
</div>
146+
146147
<% if finding["source_code_file"].to_s.strip != "" %>
147148
<div class="row">
148149
<div class="large-8 columns">
@@ -199,7 +200,7 @@
199200
</div>
200201
</div>
201202
<dl class="dl-horizontal">
202-
<div class="panel" style="word-wrap: break-word; font-family: monospace;"">
203+
<div class="panel" style="word-wrap: break-word; font-family: monospace;">
203204
<% if finding["line_number"].present? and finding["line_number"].to_i == 0 %>
204205

205206
<% else %>
@@ -221,7 +222,7 @@
221222
</dl>
222223
<% end %>
223224

224-
<% unless (["curl", "sketchy", "depot"] & finding.try(:[], "source")).empty? %>
225+
<% unless (["curl", "sketchy", "depot"] && finding.try(:[], "source")).empty? %>
225226
<div class="row">
226227
<div class="large-12 columns">
227228
<% if finding.try(:[], "match_location") == "headers" and finding.try(:[], "code_fragment") != nil%>
@@ -248,9 +249,26 @@
248249
<% (finding["after"]||[]).each do |i| %>
249250
</br>
250251
<%= i[1].to_s.rstrip %>
252+
253+
251254
<% end %>
252255
</div>
253256
</dl>
257+
258+
<% elsif finding.try(:[], "match_location") == "file" and finding.try(:[], "code_fragment") != nil%>
259+
<div class="row">
260+
<div class="large-8 columns">
261+
<dl class="dl-horizontal">
262+
<dt>File Match</dt>
263+
<dd><%= "#{finding["term"]}" %></dd>
264+
</dl>
265+
</div>
266+
</div>
267+
<dl class="dl-horizontal">
268+
<div class="panel" style="word-wrap: break-word; font-family: monospace; white-space:pre-wrap;">
269+
<b><%= highlight(h(simple_format(finding["code_fragment"].to_s.gsub('\n', '<br/>'))), h(finding["term"])) %></b>
270+
</div>
271+
</dl>
254272
<!-- CUSTOMIZE THIS FOR PATHS AND BOTH,
255273
THINK ABOUT TERMS WE MAY NEED TO -->
256274
<% elsif finding.try(:[], "match_location") == "both" and finding.try(:[], "code_fragment") != nil%>

0 commit comments

Comments
 (0)