@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.cjs +8 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3218,7 +3218,8 @@ var init_base_http_adapter = __esm({
|
|
|
3218
3218
|
parseUrl(rawUrl = "/", headers, queryParams) {
|
|
3219
3219
|
const protocol = import_shared60.StringHelper.getSingleValue(headers["x-forwarded-proto"]) ?? "https";
|
|
3220
3220
|
const host = import_shared60.StringHelper.safeStringify(headers["host"]) ?? "localhost";
|
|
3221
|
-
const
|
|
3221
|
+
const cleanHost = host.replace(/['"]/g, "");
|
|
3222
|
+
const url = new URL(rawUrl, `${protocol}://${cleanHost}`);
|
|
3222
3223
|
if (!import_shared60.Guards.isNullOrEmpty(queryParams)) {
|
|
3223
3224
|
for (const [key, value] of Object.entries(queryParams)) {
|
|
3224
3225
|
if (import_shared60.Guards.isArray(value)) {
|
|
@@ -3280,11 +3281,10 @@ var init_base_http_adapter = __esm({
|
|
|
3280
3281
|
init2.body = parsedBody;
|
|
3281
3282
|
init2.duplex = "half";
|
|
3282
3283
|
}
|
|
3284
|
+
const extendedRequest = new Request(url, init2);
|
|
3285
|
+
extendedRequest.path = url.pathname;
|
|
3283
3286
|
return {
|
|
3284
|
-
request:
|
|
3285
|
-
...new Request(url, init2),
|
|
3286
|
-
path: url.pathname
|
|
3287
|
-
},
|
|
3287
|
+
request: extendedRequest,
|
|
3288
3288
|
response: new Response()
|
|
3289
3289
|
};
|
|
3290
3290
|
}
|
|
@@ -3317,11 +3317,10 @@ var init_native_http_adapter = __esm({
|
|
|
3317
3317
|
init_base_http_adapter();
|
|
3318
3318
|
NativeHttpAdapter = class extends BaseHttpAdapter {
|
|
3319
3319
|
adapt(req, res) {
|
|
3320
|
+
const extendedRequest = req;
|
|
3321
|
+
extendedRequest.path = new URL(req.url).pathname;
|
|
3320
3322
|
return {
|
|
3321
|
-
request:
|
|
3322
|
-
...req,
|
|
3323
|
-
path: new URL(req.url).pathname
|
|
3324
|
-
},
|
|
3323
|
+
request: extendedRequest,
|
|
3325
3324
|
response: res
|
|
3326
3325
|
};
|
|
3327
3326
|
}
|