Fix content type and offset detection

This commit is contained in:
Jack Kingsman
2026-02-23 21:01:48 -08:00
parent a22224980e
commit 4b84f609b7
2 changed files with 7 additions and 8 deletions
+3 -5
View File
@@ -159,7 +159,7 @@ describe('fetchJson (via api methods)', () => {
});
describe('Content-Type header', () => {
it('always sends Content-Type: application/json on GET requests', async () => {
it('omits Content-Type on GET requests (no body)', async () => {
installMockFetch();
mockFetch.mockResolvedValueOnce({
ok: true,
@@ -169,12 +169,10 @@ describe('fetchJson (via api methods)', () => {
await api.getHealth();
const [, options] = mockFetch.mock.calls[0];
expect(options.headers).toEqual(
expect.objectContaining({ 'Content-Type': 'application/json' })
);
expect(options.headers).not.toHaveProperty('Content-Type');
});
it('always sends Content-Type: application/json on POST requests', async () => {
it('sends Content-Type: application/json on POST requests with body', async () => {
installMockFetch();
mockFetch.mockResolvedValueOnce({
ok: true,