@xeno-js/core 1.2.0 → 1.2.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.js CHANGED
@@ -3228,7 +3228,8 @@ var init_base_http_adapter = __esm({
3228
3228
  parseUrl(rawUrl = "/", headers, queryParams) {
3229
3229
  const protocol = StringHelper3.getSingleValue(headers["x-forwarded-proto"]) ?? "https";
3230
3230
  const host = StringHelper3.safeStringify(headers["host"]) ?? "localhost";
3231
- const url = new URL(rawUrl, `${protocol}://${host}`);
3231
+ const cleanHost = host.replace(/['"]/g, "");
3232
+ const url = new URL(rawUrl, `${protocol}://${cleanHost}`);
3232
3233
  if (!Guards35.isNullOrEmpty(queryParams)) {
3233
3234
  for (const [key, value] of Object.entries(queryParams)) {
3234
3235
  if (Guards35.isArray(value)) {
@@ -3290,11 +3291,10 @@ var init_base_http_adapter = __esm({
3290
3291
  init2.body = parsedBody;
3291
3292
  init2.duplex = "half";
3292
3293
  }
3294
+ const extendedRequest = new Request(url, init2);
3295
+ extendedRequest.path = url.pathname;
3293
3296
  return {
3294
- request: {
3295
- ...new Request(url, init2),
3296
- path: url.pathname
3297
- },
3297
+ request: extendedRequest,
3298
3298
  response: new Response()
3299
3299
  };
3300
3300
  }
@@ -3327,11 +3327,10 @@ var init_native_http_adapter = __esm({
3327
3327
  init_base_http_adapter();
3328
3328
  NativeHttpAdapter = class extends BaseHttpAdapter {
3329
3329
  adapt(req, res) {
3330
+ const extendedRequest = req;
3331
+ extendedRequest.path = new URL(req.url).pathname;
3330
3332
  return {
3331
- request: {
3332
- ...req,
3333
- path: new URL(req.url).pathname
3334
- },
3333
+ request: extendedRequest,
3335
3334
  response: res
3336
3335
  };
3337
3336
  }