@angular/ssr 21.2.8 → 21.2.10
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/fesm2022/_validation-chunk.mjs +57 -78
- package/fesm2022/_validation-chunk.mjs.map +1 -1
- package/fesm2022/node.mjs +34 -21
- package/fesm2022/node.mjs.map +1 -1
- package/fesm2022/ssr.mjs +19 -24
- package/fesm2022/ssr.mjs.map +1 -1
- package/package.json +7 -7
- package/third_party/beasties/THIRD_PARTY_LICENSES.txt +1 -1
- package/third_party/beasties/index.js +128 -41
- package/third_party/beasties/index.js.map +1 -1
- package/types/_app-engine-chunk.d.ts +19 -0
- package/types/node.d.ts +9 -1
|
@@ -67,6 +67,21 @@ 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
|
+
* When `trustProxyHeaders` is enabled, headers such as `X-Forwarded-Host` and
|
|
75
|
+
* `X-Forwarded-Prefix` should ideally be strictly validated at a higher infrastructure
|
|
76
|
+
* level (e.g., at the reverse proxy or API gateway) before reaching the application.
|
|
77
|
+
*
|
|
78
|
+
* If a `string[]` is provided, only those proxy headers are allowed.
|
|
79
|
+
* If `true`, all proxy headers are allowed.
|
|
80
|
+
* If `false`, proxy headers are ignored.
|
|
81
|
+
*
|
|
82
|
+
* @default undefined
|
|
83
|
+
*/
|
|
84
|
+
trustProxyHeaders?: boolean | readonly string[];
|
|
70
85
|
}
|
|
71
86
|
/**
|
|
72
87
|
* Angular server application engine.
|
|
@@ -114,6 +129,10 @@ declare class AngularAppEngine {
|
|
|
114
129
|
* A map of supported locales from the server application's manifest.
|
|
115
130
|
*/
|
|
116
131
|
private readonly supportedLocales;
|
|
132
|
+
/**
|
|
133
|
+
* The normalized allowed proxy headers.
|
|
134
|
+
*/
|
|
135
|
+
private readonly trustProxyHeaders;
|
|
117
136
|
/**
|
|
118
137
|
* A cache that holds entry points, keyed by their potential locale string.
|
|
119
138
|
*/
|
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.
|
|
@@ -181,9 +182,16 @@ declare function writeResponseToNodeResponse(source: Response, destination: Serv
|
|
|
181
182
|
* be used by web platform APIs.
|
|
182
183
|
*
|
|
183
184
|
* @param nodeRequest - The Node.js request object (`IncomingMessage` or `Http2ServerRequest`) to convert.
|
|
185
|
+
* @param trustProxyHeaders - A boolean or an array of proxy headers to trust when constructing the request URL.
|
|
186
|
+
*
|
|
187
|
+
* @remarks
|
|
188
|
+
* When `trustProxyHeaders` is enabled, headers such as `X-Forwarded-Host` and
|
|
189
|
+
* `X-Forwarded-Prefix` should ideally be strictly validated at a higher infrastructure
|
|
190
|
+
* level (e.g., at the reverse proxy or API gateway) before reaching the application.
|
|
191
|
+
*
|
|
184
192
|
* @returns A Web Standard `Request` object.
|
|
185
193
|
*/
|
|
186
|
-
declare function createWebRequestFromNodeRequest(nodeRequest: IncomingMessage | Http2ServerRequest): Request;
|
|
194
|
+
declare function createWebRequestFromNodeRequest(nodeRequest: IncomingMessage | Http2ServerRequest, trustProxyHeaders?: boolean | readonly string[]): Request;
|
|
187
195
|
|
|
188
196
|
/**
|
|
189
197
|
* Determines whether the provided URL represents the main entry point module.
|