@hyper-fetch/core 7.5.1 → 7.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyper-fetch/core",
3
- "version": "7.5.1",
3
+ "version": "7.5.2",
4
4
  "description": "Cache, Queue and Persist your requests no matter if you are online or offline!",
5
5
  "author": "Maciej Pyrc <maciekpyrc@gmail.com>, Kacper Skawina <kacper.skawina@gmail.com>",
6
6
  "homepage": "https://hyperfetch.bettertyped.com/",
@@ -72,9 +72,10 @@ export const stringifyValue = (response: string | unknown): string => {
72
72
 
73
73
  export const getAdapterHeaders = (request: RequestInstance) => {
74
74
  const isFormData = hasWindow() && request.payload instanceof FormData;
75
+ const isObject = typeof request.payload === "object" && request.payload !== null;
75
76
  const headers: HeadersInit = {};
76
77
 
77
- if (!isFormData) headers["Content-Type"] = "application/json";
78
+ if (!isFormData && isObject) headers["Content-Type"] = "application/json";
78
79
 
79
80
  Object.assign(headers, request.headers);
80
81
  return headers as HeadersInit;