Skip to content

Commit 15e89bf

Browse files
committed
Implement CR suggestions
1 parent 7e78435 commit 15e89bf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/openapi-fetch/api.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ for any request that provides value for the `body` parameter. When the `bodySeri
188188
`Content-Type` is omitted, allowing the browser to set it automatically with the correct message part boundary.
189189

190190
You can also set `Content-Type` manually through `headers` object either in the fetch options,
191-
or when instantiating the client. Setting `Content-Type` to `null` will omit the header, however the native fetch API
192-
will likely set it to `text/plain` in this case.
191+
or when instantiating the client.
193192

194193
:::
195194

packages/openapi-fetch/test/index.test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -981,9 +981,10 @@ describe("client", () => {
981981
},
982982
});
983983
// the fetch implementation won't allow sending a body without content-type,
984-
// so it invents one up and sends it, hopefully this will be consistent across
985-
// local environments and won't make the tests flaky
986-
expect(contentType).toBe("text/plain;charset=UTF-8");
984+
// and it defaults to `text/plain;charset=UTF-8`, however the actual default value
985+
// is irrelevant and might be flaky across different fetch implementations
986+
// for us, it's important that it's not `application/json`
987+
expect(contentType).not.toBe("application/json");
987988
},
988989
);
989990

0 commit comments

Comments
 (0)