mirror of
https://gitlab.com/Zer0interrupt/recipe-manager.git
synced 2026-11-01 23:24:11 -05:00
fix: include application/json Content-Type in getAuthHeaders for backup inspect and restore POST bodies
This commit is contained in:
parent
b44c4ba333
commit
c34ce4122b
2 changed files with 4 additions and 2 deletions
|
|
@ -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' };
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -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')));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue