@sourceregistry/node-webserver 1.4.0 → 1.5.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.
@@ -10,6 +10,13 @@ export interface Options {
10
10
  * @default crypto.randomUUID
11
11
  */
12
12
  generate?: () => string;
13
+ /**
14
+ * Enable client request ID handling
15
+ * When enabled, checks for X-Client-Request-Id header, validates it contains only ASCII characters and is no more than 512 characters,
16
+ * and uses it if valid. Invalid headers result in a 400 error response.
17
+ * @default false
18
+ */
19
+ clientRequestId?: boolean;
13
20
  }
14
21
  export declare function assign(options?: Options): Middleware<string, {
15
22
  requestId: string;
@@ -98,6 +98,7 @@ export declare class WebServer<TServerConfig extends ServerConfig = ServerConfig
98
98
  private getTrustedForwardedHeader;
99
99
  private isTrustedProxy;
100
100
  private normalizeAddress;
101
+ private isValidIP;
101
102
  private parseForwardedHeader;
102
103
  private toHeaders;
103
104
  private isRequestBodyAllowed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sourceregistry/node-webserver",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "TypeScript web server for Node.js with web-standard Request and Response APIs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",