Commit 07275e51 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'dast-location-fingerprint' into 'master'

Improve logical order

See merge request gitlab-org/gitlab-ee!10503
parents e98fc829 5c6ce1d5
---
title: Change order in dast location fingerprint
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['path']}:#{location['param']}:#{location['method']}") Digest::SHA1.hexdigest("#{location['path']}:#{location['method']}:#{location['param']}")
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(':GET:X-Content-Type-Options')
expected2 = Digest::SHA1.hexdigest('/:X-Content-Type-Options:GET') expected2 = Digest::SHA1.hexdigest('/:GET:X-Content-Type-Options')
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