BatchBuilder.execute() sets the correct batch header, but FMServerConnection._makeRequestEffect() overwrites it with application/json, so all $batch calls fail against FileMaker OData.
Observed app error:
OData error: Batch operation requires multipart content type
code: -1014
url: https://.../fmi/odata/v4/.../$batch
Why this looks like library bug:
src/client/batch-builder.ts:191-199 sends:
Content-Type: multipart/mixed; boundary=${boundary}
OData-Version: 4.0
src/client/filemaker-odata.ts:275-277 later rebuilds headers and unconditionally does:
headers.set("Content-Type", "application/json")
That means batch requests lose the required multipart content type before fetch.
I checked npm @proofkit/fmodata@0.1.0-beta.41; same unconditional overwrite is still present in src/client/filemaker-odata.ts.
Expected:
- preserve caller
Content-Type when already set
- or only default to
application/json for non-batch JSON requests
Possible fix:
if (!headers.has("Content-Type")) {
headers.set("Content-Type", "application/json");
}
or special-case $batch / multipart bodies.
BatchBuilder.execute()sets the correct batch header, butFMServerConnection._makeRequestEffect()overwrites it withapplication/json, so all$batchcalls fail against FileMaker OData.Observed app error:
Why this looks like library bug:
src/client/batch-builder.ts:191-199sends:Content-Type: multipart/mixed; boundary=${boundary}OData-Version: 4.0src/client/filemaker-odata.ts:275-277later rebuilds headers and unconditionally does:headers.set("Content-Type", "application/json")That means batch requests lose the required multipart content type before fetch.
I checked npm
@proofkit/fmodata@0.1.0-beta.41; same unconditional overwrite is still present insrc/client/filemaker-odata.ts.Expected:
Content-Typewhen already setapplication/jsonfor non-batch JSON requestsPossible fix:
or special-case
$batch/ multipart bodies.