@h3ravel/http 11.17.0-alpha.16 → 11.17.0
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.d.ts +0 -3
- package/dist/index.js +1 -19
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1445,9 +1445,6 @@ declare class HttpRequest {
|
|
|
1445
1445
|
*
|
|
1446
1446
|
* The base URL never ends with a /.
|
|
1447
1447
|
*
|
|
1448
|
-
* This is similar to getBasePath(), except that it also includes the
|
|
1449
|
-
* script filename (e.g. index.php) if one exists.
|
|
1450
|
-
*
|
|
1451
1448
|
* @return string The raw URL (i.e. not urldecoded)
|
|
1452
1449
|
*/
|
|
1453
1450
|
getBaseUrl(): string;
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,6 @@ import { HTTP_RESPONSE_CACHE_CONTROL_DIRECTIVES, Injectable, ResponseCodes, stat
|
|
|
8
8
|
import { Response as Response$1 } from "@h3ravel/support/facades";
|
|
9
9
|
import { Arr, DateTime, InvalidArgumentException, Obj, RuntimeException, Str, data_get, data_set, safeDot } from "@h3ravel/support";
|
|
10
10
|
import { H3Event, getQuery, getRequestIP, getRequestProtocol, getRouterParams, parseCookies } from "h3";
|
|
11
|
-
import path from "node:path";
|
|
12
11
|
//#region src/Commands/FireCommand.ts
|
|
13
12
|
var FireCommand = class extends Command {
|
|
14
13
|
/**
|
|
@@ -2893,9 +2892,6 @@ var HttpRequest = class HttpRequest {
|
|
|
2893
2892
|
*
|
|
2894
2893
|
* The base URL never ends with a /.
|
|
2895
2894
|
*
|
|
2896
|
-
* This is similar to getBasePath(), except that it also includes the
|
|
2897
|
-
* script filename (e.g. index.php) if one exists.
|
|
2898
|
-
*
|
|
2899
2895
|
* @return string The raw URL (i.e. not urldecoded)
|
|
2900
2896
|
*/
|
|
2901
2897
|
getBaseUrl() {
|
|
@@ -2923,12 +2919,6 @@ var HttpRequest = class HttpRequest {
|
|
|
2923
2919
|
* Prepares the base URL.
|
|
2924
2920
|
*/
|
|
2925
2921
|
prepareBaseUrl() {
|
|
2926
|
-
const requestUri = this.getRequestUri() ?? "";
|
|
2927
|
-
const baseUrl = "/" + path.basename(__filename);
|
|
2928
|
-
const normalizedRequestUri = requestUri.startsWith("/") ? requestUri : "/" + requestUri;
|
|
2929
|
-
if (normalizedRequestUri.startsWith(baseUrl)) return baseUrl;
|
|
2930
|
-
const dirBase = path.dirname(baseUrl);
|
|
2931
|
-
if (normalizedRequestUri.startsWith(dirBase)) return dirBase.replace(/[/\\]+$/, "");
|
|
2932
2922
|
return "";
|
|
2933
2923
|
}
|
|
2934
2924
|
/**
|
|
@@ -2958,15 +2948,7 @@ var HttpRequest = class HttpRequest {
|
|
|
2958
2948
|
* Prepares the base path.
|
|
2959
2949
|
*/
|
|
2960
2950
|
prepareBasePath() {
|
|
2961
|
-
|
|
2962
|
-
if (!baseUrl) return "";
|
|
2963
|
-
const scriptFilename = this._server.get("SCRIPT_FILENAME") ?? "";
|
|
2964
|
-
const filename = path.basename(scriptFilename);
|
|
2965
|
-
let basePath;
|
|
2966
|
-
if (path.basename(baseUrl) === filename) basePath = path.dirname(baseUrl);
|
|
2967
|
-
else basePath = baseUrl;
|
|
2968
|
-
basePath = basePath.replace(/\\/g, "/");
|
|
2969
|
-
return basePath.replace(/\/+$/, "");
|
|
2951
|
+
return Str.rtrim(this.getBaseUrl(), "/");
|
|
2970
2952
|
}
|
|
2971
2953
|
/**
|
|
2972
2954
|
* Prepares the path info.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/http",
|
|
3
|
-
"version": "11.17.0
|
|
3
|
+
"version": "11.17.0",
|
|
4
4
|
"description": "HTTP kernel, middleware pipeline, request/response classes for H3ravel.",
|
|
5
5
|
"h3ravel": {
|
|
6
6
|
"providers": [
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
"laravel"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@h3ravel/contracts": "^2.0.0
|
|
43
|
-
"@h3ravel/support": "^2.0.0
|
|
42
|
+
"@h3ravel/contracts": "^2.0.0",
|
|
43
|
+
"@h3ravel/support": "^2.0.0",
|
|
44
44
|
"@h3ravel/musket": "^1.29.0-alpha.15",
|
|
45
|
-
"@h3ravel/shared": "^2.0.0
|
|
46
|
-
"@h3ravel/session": "^2.0.0
|
|
45
|
+
"@h3ravel/shared": "^2.0.0",
|
|
46
|
+
"@h3ravel/session": "^2.0.0",
|
|
47
47
|
"h3": "2.0.1-rc.5",
|
|
48
48
|
"srvx": "^0.8.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@h3ravel/validation": "^2.0.0
|
|
52
|
-
"@h3ravel/foundation": "^2.0.0
|
|
51
|
+
"@h3ravel/validation": "^2.0.0",
|
|
52
|
+
"@h3ravel/foundation": "^2.0.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"typescript": "^6.0.0"
|