Commit 547c5d19 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'aling-dast-lf-with-other-parsers' into 'master'

Improve location fingerprint

See merge request gitlab-org/gitlab-ee!10487
parents 55764aad 9c77918a
---
title: Improve DAST location fingerprints
merge_request: 10487
author:
type: changed
...@@ -46,7 +46,7 @@ module Gitlab ...@@ -46,7 +46,7 @@ module Gitlab
end end
def generate_location_fingerprint(location) def generate_location_fingerprint(location)
Digest::SHA1.hexdigest("#{location['param']} #{location['method']} #{location['path']}") Digest::SHA1.hexdigest("#{location['path']}:#{location['param']}:#{location['method']}")
end end
end end
end end
......
...@@ -24,8 +24,8 @@ describe Gitlab::Ci::Parsers::Security::Dast do ...@@ -24,8 +24,8 @@ describe Gitlab::Ci::Parsers::Security::Dast do
end end
it 'generates expected location fingerprint' do it 'generates expected location fingerprint' do
expected1 = Digest::SHA1.hexdigest('X-Content-Type-Options GET ') expected1 = Digest::SHA1.hexdigest(':X-Content-Type-Options:GET')
expected2 = Digest::SHA1.hexdigest('X-Content-Type-Options GET /') expected2 = Digest::SHA1.hexdigest('/:X-Content-Type-Options:GET')
expect(report.occurrences.first[:location_fingerprint]).to eq(expected1) expect(report.occurrences.first[:location_fingerprint]).to eq(expected1)
expect(report.occurrences.last[:location_fingerprint]).to eq(expected2) expect(report.occurrences.last[:location_fingerprint]).to eq(expected2)
......
Markdown is supported
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