Skip to content

Commit e3f321c

Browse files
fix: add verification when request body is falsy (#1702)
* fix: add verification when request body is falsy * Update index.js * style: Update conditional check for FormData instance
1 parent f47268f commit e3f321c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/openapi-fetch/src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ export default function createClient(clientOptions) {
8484
};
8585
if (requestInit.body) {
8686
requestInit.body = bodySerializer(requestInit.body);
87-
}
88-
// remove `Content-Type` if serialized body is FormData; browser will correctly set Content-Type & boundary expression
89-
if (requestInit.body instanceof FormData) {
90-
requestInit.headers.delete("Content-Type");
87+
// remove `Content-Type` if serialized body is FormData; browser will correctly set Content-Type & boundary expression
88+
if (requestInit.body instanceof FormData) {
89+
requestInit.headers.delete("Content-Type");
90+
}
9191
}
9292

9393
let id;

0 commit comments

Comments
 (0)