@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/dist/index.esm.js
CHANGED
|
@@ -202,7 +202,6 @@ var adapter2 = (request, requestId) => __async(void 0, null, function* () {
|
|
|
202
202
|
const { method = "GET" /* get */, client } = request;
|
|
203
203
|
const httpClient = client.url.includes("https://") ? https : http;
|
|
204
204
|
const options = {
|
|
205
|
-
path: fullUrl,
|
|
206
205
|
method,
|
|
207
206
|
headers,
|
|
208
207
|
timeout: defaultTimeout
|
|
@@ -215,8 +214,9 @@ var adapter2 = (request, requestId) => __async(void 0, null, function* () {
|
|
|
215
214
|
if (payload) {
|
|
216
215
|
options.headers["Content-Length"] = Buffer.byteLength(JSON.stringify(payload));
|
|
217
216
|
}
|
|
217
|
+
const requestUrl = !fullUrl.startsWith("http") ? `http://${fullUrl}` : fullUrl;
|
|
218
218
|
return makeRequest((resolve) => {
|
|
219
|
-
const httpRequest = httpClient.request(options, (response) => {
|
|
219
|
+
const httpRequest = httpClient.request(requestUrl, options, (response) => {
|
|
220
220
|
response.setEncoding("utf8");
|
|
221
221
|
unmountListener = createAbortListener(0, xhrExtra, response.destroy, resolve);
|
|
222
222
|
let chunks = "";
|