(id: string)
| 67 | } |
| 68 | |
| 69 | function sanitizeChallengeId(id: string): string | null { |
| 70 | const sanitized = id.replace(/[^a-zA-Z0-9-_]/g, ''); |
| 71 | if (sanitized.length === 0 || sanitized.length > 100) { |
| 72 | return null; |
| 73 | } |
| 74 | return sanitized; |
| 75 | } |
| 76 | |
| 77 | export async function registerRoutes(app: Express): Promise<Server> { |
| 78 | app.use(validateInput); |