@vercel/queue 0.0.1 → 0.0.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.mjs CHANGED
@@ -964,7 +964,7 @@ function parseQueueHeaders(headers) {
964
964
  receiptHandle
965
965
  };
966
966
  }
967
- var DEFAULT_BASE_URL_RESOLVER = (region) => `https://${region}.vercel-queue.com`;
967
+ var DEFAULT_BASE_URL_RESOLVER = (region) => new URL(`https://${region}.vercel-queue.com`);
968
968
  function resolveBaseUrl(region, resolver) {
969
969
  return (resolver ?? DEFAULT_BASE_URL_RESOLVER)(region);
970
970
  }
@@ -1055,7 +1055,8 @@ var ApiClient = class _ApiClient {
1055
1055
  const encodedQueue = encodeURIComponent(queueName);
1056
1056
  const segments = pathSegments.map((s) => encodeURIComponent(s));
1057
1057
  const path2 = segments.length > 0 ? "/" + segments.join("/") : "";
1058
- return `${this.baseUrl}${BASE_PATH}/${encodedQueue}${path2}`;
1058
+ const basePath = this.baseUrl.pathname.replace(/\/+$/, "");
1059
+ return `${this.baseUrl.origin}${basePath}${BASE_PATH}/${encodedQueue}${path2}`;
1059
1060
  }
1060
1061
  async fetch(url, init) {
1061
1062
  const method = init.method || "GET";
@@ -1079,7 +1080,7 @@ var ApiClient = class _ApiClient {
1079
1080
  }
1080
1081
  console.debug("[VQS Debug] Request:", JSON.stringify(logData, null, 2));
1081
1082
  }
1082
- init.headers.set("User-Agent", `@vercel/queue/${"0.0.1"}`);
1083
+ init.headers.set("User-Agent", `@vercel/queue/${"0.0.2"}`);
1083
1084
  init.headers.set("Vqs-Client-Ts", (/* @__PURE__ */ new Date()).toISOString());
1084
1085
  const response = await fetch(url, init);
1085
1086
  if (isDebugEnabled()) {