fix: increase body size limit for large imports (#43)
- Increase nginx client_max_body_size from 10MB to 50MB - Add bodyLimit: 50MB to Fastify import route - Allows importing exports with many base64-encoded images
This commit is contained in:
@@ -389,6 +389,13 @@ export async function exportRoutes(app: FastifyInstance) {
|
||||
// ---------------------------------------------------------------------------
|
||||
app.post(
|
||||
"/import",
|
||||
{
|
||||
config: {
|
||||
// Increase body limit to 50MB to handle exports with base64 images
|
||||
rawBody: true,
|
||||
},
|
||||
bodyLimit: 50 * 1024 * 1024, // 50 MB
|
||||
},
|
||||
async (request, reply) => {
|
||||
const userId = await getUserId(request, reply);
|
||||
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ server {
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
|
||||
# Allow larger file uploads (for medication images)
|
||||
client_max_body_size 10M;
|
||||
# Allow larger file uploads (for medication images and data import/export)
|
||||
client_max_body_size 50M;
|
||||
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
|
||||
Reference in New Issue
Block a user