fix(smartproxy): Consolidate duplicate IRouteSecurity interfaces to use standardized property names (ipAllowList and ipBlockList), fix port preservation logic for preserve mode in forward actions, and update dependency versions in package.json.

This commit is contained in:
2025-05-15 09:56:32 +00:00
parent 3e411667e6
commit 94e9eafa25
6 changed files with 327 additions and 112 deletions

View File

@ -41,11 +41,12 @@ export class HttpRequestHandler {
};
// Optionally rewrite host header to match target
if (options.headers && options.headers.host) {
if (options.headers && 'host' in options.headers) {
// Only apply if host header rewrite is enabled or not explicitly disabled
const shouldRewriteHost = route?.action.options?.rewriteHostHeader !== false;
if (shouldRewriteHost) {
options.headers.host = `${destination.host}:${destination.port}`;
// Safely cast to OutgoingHttpHeaders to access host property
(options.headers as plugins.http.OutgoingHttpHeaders).host = `${destination.host}:${destination.port}`;
}
}