@angular/ssr 22.0.0-next.5 → 22.0.0-next.7

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.
@@ -67,6 +67,24 @@ interface AngularAppEngineOptions {
67
67
  * A set of allowed hostnames for the server application.
68
68
  */
69
69
  allowedHosts?: readonly string[];
70
+ /**
71
+ * Extends the scope of trusted proxy headers (`X-Forwarded-*`).
72
+ *
73
+ * @remarks
74
+ * **This is a security-sensitive option!**
75
+ *
76
+ * When `trustProxyHeaders` is enabled, request headers such as `X-Forwarded-Host` and
77
+ * `X-Forwarded-Prefix` are trusted by the server and used for routing. These
78
+ * headers must be strictly validated and provided by a trusted client (e.g., at a reverse proxy, load
79
+ * balancer, or API gateway) and must *not* be provided by untrusted end users.
80
+ *
81
+ * If a `string[]` is provided, only those proxy headers are allowed.
82
+ * If `true`, all proxy headers are allowed.
83
+ * If `false` or not provided, proxy headers are ignored.
84
+ *
85
+ * @default false
86
+ */
87
+ trustProxyHeaders?: boolean | readonly string[];
70
88
  }
71
89
  /**
72
90
  * Angular server application engine.
@@ -114,6 +132,10 @@ declare class AngularAppEngine {
114
132
  * A map of supported locales from the server application's manifest.
115
133
  */
116
134
  private readonly supportedLocales;
135
+ /**
136
+ * The normalized allowed proxy headers.
137
+ */
138
+ private readonly trustProxyHeaders;
117
139
  /**
118
140
  * A cache that holds entry points, keyed by their potential locale string.
119
141
  */
package/types/node.d.ts CHANGED
@@ -70,6 +70,7 @@ interface AngularNodeAppEngineOptions extends AngularAppEngineOptions {
70
70
  */
71
71
  declare class AngularNodeAppEngine {
72
72
  private readonly angularAppEngine;
73
+ private readonly trustProxyHeaders?;
73
74
  /**
74
75
  * Creates a new instance of the Angular Node.js server application engine.
75
76
  * @param options Options for the Angular Node.js server application engine.
@@ -180,9 +181,16 @@ declare function writeResponseToNodeResponse(source: Response, destination: Serv
180
181
  * be used by web platform APIs.
181
182
  *
182
183
  * @param nodeRequest - The Node.js request object (`IncomingMessage` or `Http2ServerRequest`) to convert.
184
+ * @param trustProxyHeaders - A boolean or an array of proxy headers to trust when constructing the request URL.
185
+ *
186
+ * @remarks
187
+ * When `trustProxyHeaders` is enabled, headers such as `X-Forwarded-Host` and
188
+ * `X-Forwarded-Prefix` should ideally be strictly validated at a higher infrastructure
189
+ * level (e.g., at the reverse proxy or API gateway) before reaching the application.
190
+ *
183
191
  * @returns A Web Standard `Request` object.
184
192
  */
185
- declare function createWebRequestFromNodeRequest(nodeRequest: IncomingMessage | Http2ServerRequest): Request;
193
+ declare function createWebRequestFromNodeRequest(nodeRequest: IncomingMessage | Http2ServerRequest, trustProxyHeaders?: boolean | readonly string[]): Request;
186
194
 
187
195
  /**
188
196
  * Determines whether the provided URL represents the main entry point module.