Skip to content

Commit

Permalink
new logic changes support for multiline body
Browse files Browse the repository at this point in the history
  • Loading branch information
avzz-19 committed Sep 6, 2024
1 parent 6be02b0 commit 60cb89e
Show file tree
Hide file tree
Showing 7 changed files with 223 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,14 @@
{{/if}}
{{/each}}

{{#if @currentVulnerability.request.body}}
{{#unless this.isRequestBodyEmpty}}
<AkTypography @color='textSecondary'>
{{t 'requestBody'}}:
</AkTypography>

<div local-class='vulnerability-finding-container'>
<pre
local-class='vulnerability-finding-description {{if
@analysis.isOverriddenAsPassed
"analysis-overridded-passed"
}}'
>
{{@currentVulnerability.request.body}}
</pre>
</div>
{{/unless}}
{{/if}}
{{#unless this.isRequestBodyEmpty}}
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox
@title={{t 'requestBody'}}
@copyIcon={{true}}
@markedAsPassed={{@analysis.isOverriddenAsPassed}}
>{{@currentVulnerability.request.body}}
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox>
{{/unless}}

{{#unless this.isRequestHeadersEmpty}}
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox
Expand All @@ -63,6 +53,17 @@
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox>
{{/unless}}

{{#unless this.isRequestCookiesEmpty}}
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox
@title={{t 'cookies'}}
@copyIcon={{true}}
@markedAsPassed={{@analysis.isOverriddenAsPassed}}
>{{#each-in @currentVulnerability.response.cookies as |key value|}}<span
>{{key}}: {{value}}</span>
{{/each-in}}
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox>
{{/unless}}

{{#if @currentVulnerability.response.status_code}}
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox
@title={{t 'response'}}
Expand All @@ -82,6 +83,17 @@
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox>
{{/unless}}

{{#unless this.isResponseCookiesEmpty}}
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox
@title={{t 'cookies'}}
@copyIcon={{true}}
@markedAsPassed={{@analysis.isOverriddenAsPassed}}
>{{#each-in @currentVulnerability.response.cookies as |key value|}}<span
>{{key}}: {{value}}</span>
{{/each-in}}
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox>
{{/unless}}

{{#unless this.isResponseBodyEmpty}}
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox
@title={{t 'responseBody'}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ export default class FileDetailsVulnerabilityAnalysisDetailsFindingsVulnerableAp
return body === "''" || body === '';
}

get isRequestCookiesEmpty() {
const cookies = this.args.currentVulnerability?.request?.cookies;

return cookies && Object.keys(cookies).length === 0;
}

get isResponseCookiesEmpty() {
const cookies = this.args.currentVulnerability?.response?.cookies;

return cookies && Object.keys(cookies).length === 0;
}

get requestParamsKey() {
const key = this.args.currentVulnerability?.request.params.key;

Expand Down
Loading

0 comments on commit 60cb89e

Please sign in to comment.