[Critical] apiFetch headers spread overwrites Content-Type when custom headers passed #38

Closed
opened 2026-05-24 14:05:02 -04:00 by zgaetano · 0 comments
Owner

File: data.jsx:17-22, also js/api.js:14-21
Severity: Critical

...opts is spread AFTER headers, so any caller that passes custom headers in opts replaces the entire Content-Type header instead of extending it. Not triggered yet but will break the first time auth tokens or custom headers are added.

Fix: Move ...opts before headers, or use { ...opts, headers: { 'Content-Type': 'application/json', ...(opts.headers || {}) } }.

**File:** data.jsx:17-22, also js/api.js:14-21 **Severity:** Critical ...opts is spread AFTER headers, so any caller that passes custom headers in opts replaces the entire Content-Type header instead of extending it. Not triggered yet but will break the first time auth tokens or custom headers are added. **Fix:** Move ...opts before headers, or use { ...opts, headers: { 'Content-Type': 'application/json', ...(opts.headers || {}) } }.
zgaetano added the
bug
label 2026-05-24 14:05:02 -04:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#38
No description provided.