mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -42,6 +42,7 @@ recoverInterruptedInstalls();
|
|||||||
const app = Fastify({
|
const app = Fastify({
|
||||||
logger: { level: env.LOG_LEVEL },
|
logger: { level: env.LOG_LEVEL },
|
||||||
bodyLimit: env.MAX_UPLOAD_SIZE_MB > 0 ? env.MAX_UPLOAD_SIZE_MB * 1024 * 1024 : 1073741824,
|
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) => {
|
app.setErrorHandler((error: Error & { statusCode?: number }, request, reply) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user