refactor: deduplicate sanitizeFilename, add template+sanitize unit tests, fix esc single-quote
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 11m38s
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 11m38s
This commit is contained in:
parent
c4fea7932c
commit
0a002f94ef
6 changed files with 89 additions and 9 deletions
|
|
@ -2,10 +2,7 @@ import { Router, Request, Response } from "express";
|
|||
import { renderPdf } from "../services/browser.js";
|
||||
import logger from "../services/logger.js";
|
||||
import { templates, renderTemplate } from "../services/templates.js";
|
||||
|
||||
function sanitizeFilename(name: string): string {
|
||||
return name.replace(/["\r\n\x00-\x1f]/g, "_").substring(0, 200);
|
||||
}
|
||||
import { sanitizeFilename } from "../utils/sanitize.js";
|
||||
|
||||
export const templatesRouter = Router();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue