Skip to content

Commit

Permalink
fix: force json response for date manipulation vulnerable endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pmstss committed Sep 4, 2024
1 parent 721a32e commit a88499d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/misc/misc.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ export class MiscController {
@Query('from') from: string,
@Query('to') to: string,
@Query('weekday') weekday?: string
): Promise<string> {
): Promise<{ count: number }> {
const count = await this.dateService.calculateWeekdays(
from,
to,
weekday ? +weekday : 1
);

return JSON.stringify({ count }, null, 2);
return { count };
}
}

0 comments on commit a88499d

Please sign in to comment.