Skip to content

Commit ff5c633

Browse files
fix(openapi-fetch): revert unnecessary change
`baseHeaders` is still the same object via reference, we can just access it directly.
1 parent 4572aeb commit ff5c633

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/openapi-fetch/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ export default function createClient<Paths extends {}>(clientOptions: ClientOpti
122122
redirect: "follow",
123123
...options,
124124
...init,
125+
headers: baseHeaders,
125126
};
126127
if (requestBody) requestInit.body = bodySerializer(requestBody as any);
127128
// remove `Content-Type` if serialized body is FormData; browser will correctly set Content-Type & boundary expression
128129
if (requestInit.body instanceof FormData) baseHeaders.delete("Content-Type");
129-
requestInit.headers = baseHeaders;
130130
const response = await fetch(finalURL, requestInit);
131131

132132
// handle empty content

0 commit comments

Comments
 (0)