fix: do not render regexp hostname in debug endpoint response

This commit is contained in:
Nicolas Duchon committed 2024-11-04 23:03:01 +01:00
1 parent a79445feef
commit fdb7310cda
3 files changed
+21 -2

No files matched your search

+2 -1
View File
@@ -380,7 +380,8 @@ upstream {{ $vpath.upstream }} {
{{- end }}
{{- $debug_vhost := deepCopy .VHost }}
{{- $_ := set $debug_vhost "hostname" .Hostname }}
{{- /* If it's a regexp, do not render the Hostname to the response to avoid rendering config breaking characters */}}
{{- $_ := set $debug_vhost "hostname" (.VHost.is_regexp | ternary "Hostname is a regexp and unsafe to include in the debug response." .Hostname) }}
{{- $_ := set $debug_vhost "paths" $debug_paths }}
{{- $debug_response := dict