Skip to content

Commit

Permalink
remove extra log and fix sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 23, 2024
1 parent abd38ae commit 1500d77
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/v2/controller/post.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ export class PostController extends Controller {
return this.service.getChangelogForId(id);
}
private sanitizeDescription(input: string): string {
return DOMPurify.sanitize(input);
}
/**
* Creates post and returns the created post
* @param postToCreate Post information
Expand All @@ -106,7 +102,8 @@ export class PostController extends Controller {
@Security("discord", ["administrator"])
@Post("")
public createPost(@Body() postToCreate: CreateWebsitePost): Promise<WebsitePost> {
postToCreate.description = this.sanitizeDescription(postToCreate.description);
// sanitize from the start
postToCreate.description = DOMPurify.sanitize(postToCreate.description);
return this.service.create(postToCreate);
}

Expand All @@ -124,9 +121,6 @@ export class PostController extends Controller {
@Body() postToUpdate: CreateWebsitePost,
): Promise<WebsitePost> {
postToUpdate.description = this.sanitizeDescription(postToUpdate.description);

console.log(JSON.stringify(postToUpdate.changelog, null, 4));

return this.service.update(id, postToUpdate);
}

Expand Down

0 comments on commit 1500d77

Please sign in to comment.