Description
In fetchModelsFromApi() (index.mjs:433-438), the Content-Type: application/json header is set on a GET request that has no body:
const res = await fetch(`${apiBaseURL}/models`, {
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json", // ← unnecessary for GET
},
});
Per HTTP semantics (RFC 9110 §8.3), Content-Type describes the representation data in the message body. A GET request has no body, so this header is semantically incorrect.
Impact
- Functionally harmless — most servers ignore
Content-Type on GET requests.
- Some strict API gateways or WAFs might log warnings or behave unexpectedly.
- Misleading for developers reading the code — suggests the request sends a body.
Proposed fix
const res = await fetch(`${apiBaseURL}/models`, {
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
If an Accept header is desired:
headers: {
Authorization: `Bearer ${apiKey}`,
Accept: "application/json",
},
Acceptance criteria
🤖 Generated with Claude Code
Description
In
fetchModelsFromApi()(index.mjs:433-438), theContent-Type: application/jsonheader is set on a GET request that has no body:Per HTTP semantics (RFC 9110 §8.3),
Content-Typedescribes the representation data in the message body. A GET request has no body, so this header is semantically incorrect.Impact
Content-Typeon GET requests.Proposed fix
If an
Acceptheader is desired:Acceptance criteria
Content-Typeheader is removed from the GET/modelsrequest.Accept: application/jsonis added if the API benefits from explicit content negotiation."should fetch and sort models"passes with updated header expectations.🤖 Generated with Claude Code