diff --git a/docs/development/CENTRAL.md b/docs/development/CENTRAL.md index 160d40e..d1e443b 100644 --- a/docs/development/CENTRAL.md +++ b/docs/development/CENTRAL.md @@ -109,3 +109,4 @@ - [Final Pool Layout Fix](./devlog/2025-12-18-043500_pool_sizing_final.md): Completed. Overhauled flex layout for Horizontal Pool to ensure card images scale 1:1 with panel height during resize, removing layout-blocking transitions. - [Pool Overflow Constraint](./devlog/2025-12-18-044500_pool_overflow_fix.md): Completed. Enforce flex shrinkage with `min-h-0` and `overflow-hidden` to strictly bind card height to resizeable panel. - [Resize Persistence](./devlog/2025-12-18-050000_resize_persistence.md): Completed. Implemented `localStorage` persistence for Sidebars and Pool Panels in both Draft and Deck Views. +- [Resolve 413 Errors](./devlog/2025-12-18-112633_resolve_413_errors.md): Completed. Updated Helm ingress annotations and server limits to allow unlimited upload size. diff --git a/docs/development/devlog/2025-12-18-112633_resolve_413_errors.md b/docs/development/devlog/2025-12-18-112633_resolve_413_errors.md new file mode 100644 index 0000000..3170b69 --- /dev/null +++ b/docs/development/devlog/2025-12-18-112633_resolve_413_errors.md @@ -0,0 +1,16 @@ +# Resolve 413 Request Entity Too Large Errors + +## Objective +Fix the "413 Request Entity Too Large" errors occurring during large uploads or requests after application deployment. + +## Changes +1. **Helm Chart Configuration (`helm/mtg-draft-maker/values.yaml`)**: + * Added Nginx Ingress annotation `nginx.ingress.kubernetes.io/proxy-body-size: "0"` to disable the body size limit check at the ingress level. + +2. **Server Configuration (`src/server/index.ts`)**: + * Increased `maxHttpBufferSize` for Socket.IO to 1GB. + * Increased `express.json` body parser limit to 1000MB to support large JSON payloads (e.g., extensive card lists). + +## Verification +* **Infrastructure**: Ensure the application is redeployed with the updated Helm chart for the ingress annotation to take effect. +* **Application**: Verify that large payloads can be sent to the server without triggering 413 errors. diff --git a/helm/mtg-draft-maker/values.yaml b/helm/mtg-draft-maker/values.yaml index 9c89386..b37f75d 100644 --- a/helm/mtg-draft-maker/values.yaml +++ b/helm/mtg-draft-maker/values.yaml @@ -43,7 +43,8 @@ service: ingress: enabled: false className: "" - annotations: {} + annotations: + nginx.ingress.kubernetes.io/proxy-body-size: "0" # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: diff --git a/src/client/dev-dist/sw.js b/src/client/dev-dist/sw.js index 1d6341f..cada001 100644 --- a/src/client/dev-dist/sw.js +++ b/src/client/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-5a5d9309'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.7uegorivig4" + "revision": "0.afjkvsk6jt" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/src/server/index.ts b/src/server/index.ts index 1d59cda..7dbb89d 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -17,7 +17,7 @@ const __dirname = path.dirname(__filename); const app = express(); const httpServer = createServer(app); const io = new Server(httpServer, { - maxHttpBufferSize: 300 * 1024 * 1024, // 300MB + maxHttpBufferSize: 1024 * 1024 * 1024, // 1GB (Unlimited for practical use) cors: { origin: "*", // Adjust for production, methods: ["GET", "POST"] @@ -33,7 +33,7 @@ const packGeneratorService = new PackGeneratorService(); const cardParserService = new CardParserService(); const PORT = process.env.PORT || 3000; -app.use(express.json({ limit: '50mb' })); // Increase limit for large card lists +app.use(express.json({ limit: '1000mb' })); // Increase limit for large card lists // Serve static images (Nested) app.use('/cards', express.static(path.join(__dirname, 'public/cards')));