@hyper-fetch/core 7.5.0 → 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/dist/browser/index.js +5 -3
- package/dist/browser/index.js.map +2 -2
- package/dist/index.js +8 -5
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/src/adapter/adapter.utils.ts +2 -1
- package/src/http-adapter/http-adapter.browser.ts +3 -2
- package/src/http-adapter/http-adapter.server.ts +3 -2
package/dist/browser/index.js
CHANGED
|
@@ -2457,8 +2457,9 @@ var stringifyValue = (response) => {
|
|
|
2457
2457
|
};
|
|
2458
2458
|
var getAdapterHeaders = (request) => {
|
|
2459
2459
|
const isFormData = hasWindow() && request.payload instanceof FormData;
|
|
2460
|
+
const isObject = typeof request.payload === "object" && request.payload !== null;
|
|
2460
2461
|
const headers = {};
|
|
2461
|
-
if (!isFormData) headers["Content-Type"] = "application/json";
|
|
2462
|
+
if (!isFormData && isObject) headers["Content-Type"] = "application/json";
|
|
2462
2463
|
Object.assign(headers, request.headers);
|
|
2463
2464
|
return headers;
|
|
2464
2465
|
};
|
|
@@ -2846,8 +2847,9 @@ var getAdapter = () => new Adapter({
|
|
|
2846
2847
|
onRequestProgress,
|
|
2847
2848
|
onSuccess
|
|
2848
2849
|
}) {
|
|
2849
|
-
const { method, client, endpoint } = request;
|
|
2850
|
-
const
|
|
2850
|
+
const { method, client, endpoint, queryParams } = request;
|
|
2851
|
+
const queryString = queryParams ? stringifyQueryParams(queryParams) : "";
|
|
2852
|
+
const fullUrl = `${client.url}${endpoint}${queryString}`;
|
|
2851
2853
|
const xhr = new XMLHttpRequest();
|
|
2852
2854
|
xhr.timeout = defaultTimeout;
|
|
2853
2855
|
const onAbort = () => xhr.abort();
|