fix: include application/json Content-Type in getAuthHeaders for backup inspect and restore POST bodies

This commit is contained in:
Chris 2026-10-31 01:25:20 -04:00
parent b44c4ba333
commit c34ce4122b
2 changed files with 4 additions and 2 deletions

View file

@ -524,7 +524,9 @@ function closeModal(id) {
// Helper: get authentication headers for fetches // Helper: get authentication headers for fetches
function getAuthHeaders() { function getAuthHeaders() {
const token = localStorage.getItem('gourmet_token'); const token = localStorage.getItem('gourmet_token');
return token ? { 'Authorization': `Bearer ${token}` } : {}; return token
? { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }
: { 'Content-Type': 'application/json' };
} }
// ------------------------------------------------------------- // -------------------------------------------------------------

View file

@ -343,7 +343,7 @@ try {
const activeSessions = new Map(); const activeSessions = new Map();
app.use(cors()); 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.urlencoded({ limit: '100mb', extended: true }));
app.use(express.static(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'public')));