summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-05-23 21:23:24 +0200
committerGitHub <noreply@github.com>2024-05-23 21:23:24 +0200
commit3e69d8bbe01b7d03c894e21ac322974799098676 (patch)
tree75ad19124b91c3e29142b40660a839c2fa17f8f9 /src
parent5678e37fd0b37b266330cf2d1fde79071a96bf2b (diff)
parente1450096b4c667a4c33a3fcd8f67ebf6a39d441d (diff)
downloadvyos-1x-3e69d8bbe01b7d03c894e21ac322974799098676.tar.gz
vyos-1x-3e69d8bbe01b7d03c894e21ac322974799098676.zip
Merge pull request #3487 from Embezzle/T6370
reverse-proxy: T6370: Set custom HTTP headers in reverse-proxy responses
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/load-balancing_reverse-proxy.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/load-balancing_reverse-proxy.py b/src/conf_mode/load-balancing_reverse-proxy.py
index 1569d8d71..a4efb1cd8 100755
--- a/src/conf_mode/load-balancing_reverse-proxy.py
+++ b/src/conf_mode/load-balancing_reverse-proxy.py
@@ -88,6 +88,12 @@ def verify(lb):
if {'send_proxy', 'send_proxy_v2'} <= set(bk_server_conf):
raise ConfigError(f'Cannot use both "send-proxy" and "send-proxy-v2" for server "{bk_server}"')
+ # Check if http-response-headers are configured in any frontend/backend where mode != http
+ for group in ['service', 'backend']:
+ for config_name, config in lb[group].items():
+ if 'http_response_headers' in config and ('mode' not in config or config['mode'] != 'http'):
+ raise ConfigError(f'{group} {config_name} must be set to http mode to use http_response_headers!')
+
if 'ssl' in back_config:
if {'no_verify', 'ca_certificate'} <= set(back_config['ssl']):
raise ConfigError(f'backend {back} cannot have both ssl options no-verify and ca-certificate set!')