Commit c7646a2c authored by Fernando's avatar Fernando

Imrprove supported_message lookup

* Don't use hard coded index
parent 1e5704bf
...@@ -87,7 +87,9 @@ export default { ...@@ -87,7 +87,9 @@ export default {
status_code: statusCode, status_code: statusCode,
reason_phrase: reasonPhrase, reason_phrase: reasonPhrase,
headers = [], headers = [],
} = this.vulnerability?.supporting_messages[1].response; } = this.vulnerability?.supporting_messages?.find(
msg => msg.name === SUPPORTING_MESSAGE_TYPES.RECORDED,
).response;
const headerLines = this.getHeadersAsCodeBlockLines(headers); const headerLines = this.getHeadersAsCodeBlockLines(headers);
return statusCode && reasonPhrase && headerLines return statusCode && reasonPhrase && headerLines
...@@ -122,9 +124,8 @@ export default { ...@@ -122,9 +124,8 @@ export default {
}, },
recordedResponseData() { recordedResponseData() {
if ( if (
!( !this.vulnerability?.supporting_messages?.find(
this.vulnerability?.supporting_messages && msg => msg.name === SUPPORTING_MESSAGE_TYPES.RECORDED,
this.vulnerability.supporting_messages[1]?.name === SUPPORTING_MESSAGE_TYPES.RECORDED
) )
) { ) {
return []; return [];
......
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