Open AndersonQ opened 3 months ago
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)
We unconditionally set Content-Type to application/json
in our Fleet client which is right everywhere except for the Chunk upload endpoint.
For confirmed bugs, please report:
/api/fleet/uploads/
. It'll be set asapplication/json
The Elastic Agent does not correctly set the content-type for outgoing requests. It actually has
application/json
for any request made to Fleet Server:https://github.com/elastic/elastic-agent/blob/2ac8064fae2e56fcebfd0f7ad5d57bbffb093dce/internal/pkg/remote/client.go#L189-L192
Fleet Server API defines the content-type for the upload API
/api/fleet/uploads/{id}/{chunkNum}
as*/*
, notapplication/json
:https://github.com/elastic/fleet-server/blob/e52dd873b7fa3ef035b45c1b1e14f6ae697db8a1/model/openapi.yml#L1566-L1573
The Elastic Agent should correctly set the content-type of the request it makes to:
It's important as customer might have proxies or firewalls that rely or require the content type header to match the actual content type of the request body