Skip to content

Commit 21f1b33

Browse files
committed
Implement CR suggestions
1 parent b383196 commit 21f1b33

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
@@ -979,9 +979,10 @@ describe("client", () => {
979979
},
980980
});
981981
// the fetch implementation won't allow sending a body without content-type,
982-
// so it invents one up and sends it, hopefully this will be consistent across
983-
// local environments and won't make the tests flaky
984-
expect(contentType).toBe("text/plain;charset=UTF-8");
982+
// and it defaults to `text/plain;charset=UTF-8`, however the actual default value
983+
// is irrelevant and might be flaky across different fetch implementations
984+
// for us, it's important that it's not `application/json`
985+
expect(contentType).not.toBe("application/json");
985986
},
986987
);
987988

0 commit comments

Comments
 (0)