fix: raise maxParamLength to 500 for long filenames

Fastify's find-my-way router defaults maxParamLength to 100 chars.
Files with long names (e.g., stock photo filenames >100 chars) would
return 404 on download because the :filename param exceeded the limit.
This commit is contained in:
ashim-hq
2026-04-20 23:43:29 +08:00
parent 7dd6023b8e
commit 1807a4ddfd
+1
View File
@@ -42,6 +42,7 @@ recoverInterruptedInstalls();
const app = Fastify({
logger: { level: env.LOG_LEVEL },
bodyLimit: env.MAX_UPLOAD_SIZE_MB > 0 ? env.MAX_UPLOAD_SIZE_MB * 1024 * 1024 : 1073741824,
maxParamLength: 500,
});
app.setErrorHandler((error: Error & { statusCode?: number }, request, reply) => {