Skip to content
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

Merged
merged 4 commits into from
Nov 15, 2018

Conversation

bnjjj
Copy link
Contributor

@bnjjj bnjjj commented Nov 12, 2018

Signed-off-by: Benjamin Coenen [email protected]

  1. Description
  2. Related issues
  3. About tests
  4. Mentions

@ovh/cds


@Pipe({ name: 'safeHtml'})
export class SafeHtmlPipe implements PipeTransform {
constructor(private sanitized: DomSanitizer) {}
transform(value) {
return this.sanitized.bypassSecurityTrustHtml(value);
transform(value: string, sanitize: boolean) {
Copy link
Member

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) {
Copy link
Member

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

Copy link
Contributor Author

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

ui/src/assets/i18n/fr.json Outdated Show resolved Hide resolved
ui/src/assets/i18n/fr.json Outdated Show resolved Hide resolved
@sguiheux sguiheux merged commit 1212547 into master Nov 15, 2018
@fsamin fsamin deleted the feat_logs_view branch November 15, 2018 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants