We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e82b00 commit 36ccad3Copy full SHA for 36ccad3
.changeset/hot-stingrays-sing.md
@@ -0,0 +1,6 @@
1
+---
2
+'@modern-js/server-core': patch
3
4
+
5
+fix: custom server hook context request.path should carray query str
6
+fix: custom server hook context request.path 应该带上 query 字符串
packages/server/core/src/plugins/customServer/base.ts
@@ -61,7 +61,12 @@ class BaseHookRequest implements ModernRequest {
61
62
get url(): string {
63
// compat old middlwares,
64
- return this.#req.path;
65
+ const query = this.#c.req.query();
66
+ const q = Object.entries(query)
67
+ .map(([key, value]) => `${key}=${value}`)
68
+ .join('&');
69
+ return q ? `${this.#c.req.path}?${q}` : this.#c.req.path;
70
}
71
72
// TODO: remove next major version
0 commit comments