@jayfong/x-server 1.34.1 → 1.34.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.
@@ -97,6 +97,9 @@ class Server {
97
97
  this.fastify.route({
98
98
  method: serverMethod,
99
99
  url: item.path,
100
+ constraints: handlerOptions.requestHost ? {
101
+ host: handlerOptions.requestHost
102
+ } : undefined,
100
103
  websocket: isWS,
101
104
  handler: async (req, res) => {
102
105
  const url = `${appUrl}${// 结构:/test/sss?x=2
@@ -82,6 +82,9 @@ export class Server {
82
82
  this.fastify.route({
83
83
  method: serverMethod,
84
84
  url: item.path,
85
+ constraints: handlerOptions.requestHost ? {
86
+ host: handlerOptions.requestHost
87
+ } : undefined,
85
88
  websocket: isWS,
86
89
  handler: async (req, res) => {
87
90
  const url = `${appUrl}${// 结构:/test/sss?x=2
@@ -102,6 +102,10 @@ export declare namespace XHandler {
102
102
  * @default POST
103
103
  */
104
104
  requestMethod?: TReqMethod;
105
+ /**
106
+ * 请求 Host
107
+ */
108
+ requestHost?: string | RegExp;
105
109
  /**
106
110
  * 请求路径
107
111
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "1.34.1",
3
+ "version": "1.34.2",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",