-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): ansi and html in logs is now displayed (#3166) #3582
Conversation
Signed-off-by: Benjamin Coenen <[email protected]>
|
||
@Pipe({ name: 'safeHtml'}) | ||
export class SafeHtmlPipe implements PipeTransform { | ||
constructor(private sanitized: DomSanitizer) {} | ||
transform(value) { | ||
return this.sanitized.bypassSecurityTrustHtml(value); | ||
transform(value: string, sanitize: boolean) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create unit test for <script>alert("test")</script>
and <div onclick="alert('test')"></div>
transform(value) { | ||
return this.sanitized.bypassSecurityTrustHtml(value); | ||
transform(value: string, sanitize: boolean) { | ||
if (!sanitize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe sanitize should not be optional for safeHtml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main goal here is to not do the process twice. In the ansi_up lib when we active the escape html it already do that. It's just for perf. But I'll change the default behavior in order to sanitize by default
Signed-off-by: Benjamin Coenen <[email protected]>
e889838
to
0015c42
Compare
Co-Authored-By: bnjjj <[email protected]>
Co-Authored-By: bnjjj <[email protected]>
Signed-off-by: Benjamin Coenen [email protected]
@ovh/cds