diff --git a/dashboards/tracker-web/src/app/api/fleet/[...path]/route.ts b/dashboards/tracker-web/src/app/api/fleet/[...path]/route.ts index 8d6bc366..9237ccd3 100644 --- a/dashboards/tracker-web/src/app/api/fleet/[...path]/route.ts +++ b/dashboards/tracker-web/src/app/api/fleet/[...path]/route.ts @@ -18,7 +18,7 @@ async function proxy(req: NextRequest, { params }: { params: Promise<{ path: str }); try { - const headers: Record = { 'Content-Type': 'application/json' }; + const headers: Record = {}; const auth = req.headers.get('authorization'); if (auth) headers['Authorization'] = auth; @@ -37,7 +37,13 @@ async function proxy(req: NextRequest, { params }: { params: Promise<{ path: str if (req.method !== 'GET' && req.method !== 'HEAD') { const body = await req.text(); - if (body) fetchOptions.body = body; + if (body) { + fetchOptions.body = body; + // Only declare a JSON body when there actually is one — bodyless POSTs + // (operator actions: ship/requeue/cancel) must NOT send Content-Type, or + // the backend rejects them with FST_ERR_CTP_EMPTY_JSON_BODY. + headers['Content-Type'] = 'application/json'; + } } const res = await fetch(url.toString(), fetchOptions);