When using @apollo/datasource-rest @6.4.1 the content-type header is conditionally set if not already present. However, the check only looks for 'content-type' in lowercase, while manual settings like 'Content-Type' (capitalized, as commonly written) are not recognized.
This results in two Content-Type headers being sent in the request — one manually set (Content-Type) and one automatically set (content-type), leading to duplicated headers.
Expected Behavior:
The RESTDataSource should normalize existing header keys (case-insensitively) before deciding whether to set content-type.
Impact:
Breaks strict HTTP servers or proxies expecting one Content-Type header
Causes unexpected behaviors in backend systems (e.g., parsing issues)
When using @apollo/datasource-rest @6.4.1 the content-type header is conditionally set if not already present. However, the check only looks for 'content-type' in lowercase, while manual settings like 'Content-Type' (capitalized, as commonly written) are not recognized.
This results in two Content-Type headers being sent in the request — one manually set (Content-Type) and one automatically set (content-type), leading to duplicated headers.
Expected Behavior:
The RESTDataSource should normalize existing header keys (case-insensitively) before deciding whether to set content-type.
Impact: