diff --git a/frontend/src/composables/useApi.js b/frontend/src/composables/useApi.js index cc88c0d..1be0c31 100644 --- a/frontend/src/composables/useApi.js +++ b/frontend/src/composables/useApi.js @@ -24,8 +24,16 @@ async function request(method, url, { body, params, signal } = {}) { const headers = {} const init = { method, headers, signal } if (body !== undefined) { - headers['Content-Type'] = 'application/json' - init.body = JSON.stringify(body) + if (body instanceof FormData) { + // Let the browser set Content-Type with the multipart boundary. + // JSON-stringifying FormData produces "{}" and the backend sees + // an empty multipart payload (this broke FC-5 IR/GS ingest from + // the UI for several releases). + init.body = body + } else { + headers['Content-Type'] = 'application/json' + init.body = JSON.stringify(body) + } } const r = await fetch(fullUrl, init)