@hyper-fetch/core 5.1.0 → 5.1.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.cjs.js.map +2 -2
- package/dist/browser/index.esm.js.map +2 -2
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +2 -2
- package/package.json +1 -1
- package/src/adapter/adapter.bindings.ts +1 -0
- package/src/adapter/adapter.server.ts +3 -2
package/package.json
CHANGED
|
@@ -57,6 +57,7 @@ export const getAdapterBindings = async <T extends AdapterInstance = AdapterType
|
|
|
57
57
|
const { client, abortKey, queueKey, endpoint, data } = request;
|
|
58
58
|
|
|
59
59
|
const fullUrl = url + endpoint;
|
|
60
|
+
|
|
60
61
|
const effects = client.effects.filter((effect) => request.effectKey === effect.getEffectKey());
|
|
61
62
|
const headers = headerMapper(request);
|
|
62
63
|
let payload = data;
|
|
@@ -26,7 +26,6 @@ export const adapter: AdapterType = async (request, requestId) => {
|
|
|
26
26
|
const { method = HttpMethodsEnum.get, client } = request;
|
|
27
27
|
const httpClient = client.url.includes("https://") ? https : http;
|
|
28
28
|
const options = {
|
|
29
|
-
path: fullUrl,
|
|
30
29
|
method,
|
|
31
30
|
headers: headers as OutgoingHttpHeaders,
|
|
32
31
|
timeout: defaultTimeout,
|
|
@@ -43,8 +42,10 @@ export const adapter: AdapterType = async (request, requestId) => {
|
|
|
43
42
|
options.headers["Content-Length"] = Buffer.byteLength(JSON.stringify(payload));
|
|
44
43
|
}
|
|
45
44
|
|
|
45
|
+
const requestUrl = !fullUrl.startsWith("http") ? `http://${fullUrl}` : fullUrl;
|
|
46
|
+
|
|
46
47
|
return makeRequest((resolve) => {
|
|
47
|
-
const httpRequest = httpClient.request(options, (response) => {
|
|
48
|
+
const httpRequest = httpClient.request(requestUrl, options, (response) => {
|
|
48
49
|
response.setEncoding("utf8");
|
|
49
50
|
unmountListener = createAbortListener(0, xhrExtra, response.destroy, resolve);
|
|
50
51
|
|