Skip to content

Commit

Permalink
flowdisplay: aggregate HTTP Authorization headers
Browse files Browse the repository at this point in the history
  • Loading branch information
aiooss-anssi committed Nov 18, 2024
1 parent 8cb6abe commit c469a53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions webapp/static/js/flowdisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,18 @@ class FlowDisplay {
document.querySelector('#display-app > header > a').href = `api/replay-http/${flowId}`
const headerUserAgents = new Set()
const headerServers = new Set()
const headerAuthorization = new Set()
const headerCookies = new Set()
flow[appProto].forEach(data => {
data.request_headers?.filter(x => x.name === 'User-Agent')?.forEach(x => headerUserAgents.add(x.value))
data.response_headers?.filter(x => x.name === 'Server')?.forEach(x => headerServers.add(x.value))
data.request_headers?.filter(x => x.name === 'Authorization')?.forEach(x => headerAuthorization.add(x.value.split(';')[0]))
data.request_headers?.filter(x => x.name === 'Cookie')?.forEach(x => headerCookies.add(x.value))
data.response_headers?.filter(x => x.name === 'Set-Cookie')?.forEach(x => headerCookies.add(x.value.split(';')[0]))
})
body.textContent += headerUserAgents.size ? `User-Agent: ${[...headerUserAgents].join(', ')}\n` : ''
body.textContent += headerServers.size ? `Server: ${[...headerServers].join(', ')}\n` : ''
body.textContent += headerAuthorization.size ? `Authorization: ${[...headerAuthorization].join(', ')}\n` : ''
body.textContent += headerCookies.size ? `Cookie: ${[...headerCookies].join(', ')}\n\n` : '\n'
}

Expand Down

0 comments on commit c469a53

Please sign in to comment.