@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/index.cjs.js CHANGED
@@ -306,7 +306,6 @@ var adapter2 = (request, requestId) => __async(void 0, null, function* () {
306
306
  const { method = "GET" /* get */, client } = request;
307
307
  const httpClient = client.url.includes("https://") ? import_https.default : import_http.default;
308
308
  const options = {
309
- path: fullUrl,
310
309
  method,
311
310
  headers,
312
311
  timeout: defaultTimeout
@@ -319,8 +318,9 @@ var adapter2 = (request, requestId) => __async(void 0, null, function* () {
319
318
  if (payload) {
320
319
  options.headers["Content-Length"] = Buffer.byteLength(JSON.stringify(payload));
321
320
  }
321
+ const requestUrl = !fullUrl.startsWith("http") ? `http://${fullUrl}` : fullUrl;
322
322
  return makeRequest((resolve) => {
323
- const httpRequest = httpClient.request(options, (response) => {
323
+ const httpRequest = httpClient.request(requestUrl, options, (response) => {
324
324
  response.setEncoding("utf8");
325
325
  unmountListener = createAbortListener(0, xhrExtra, response.destroy, resolve);
326
326
  let chunks = "";