From c34ce4122be73f3bf034c0f49ae6b5746e934998 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 31 Oct 2026 01:25:20 -0400 Subject: [PATCH] fix: include application/json Content-Type in getAuthHeaders for backup inspect and restore POST bodies --- public/app.js | 4 +++- server.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/app.js b/public/app.js index fb24984..fa4851b 100644 --- a/public/app.js +++ b/public/app.js @@ -524,7 +524,9 @@ function closeModal(id) { // Helper: get authentication headers for fetches function getAuthHeaders() { const token = localStorage.getItem('gourmet_token'); - return token ? { 'Authorization': `Bearer ${token}` } : {}; + return token + ? { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } + : { 'Content-Type': 'application/json' }; } // ------------------------------------------------------------- diff --git a/server.js b/server.js index 51de31f..4c26977 100644 --- a/server.js +++ b/server.js @@ -343,7 +343,7 @@ try { const activeSessions = new Map(); app.use(cors()); -app.use(express.json({ limit: '100mb' })); +app.use(express.json({ limit: '100mb', type: ['application/json', 'text/plain'] })); app.use(express.urlencoded({ limit: '100mb', extended: true })); app.use(express.static(path.join(__dirname, 'public')));