Skip to content

Commit c69f55b

Browse files
committed
Simplify data types and array handling
The type Stdlib::Host includes Stdlib::IP::Address, so the variant is redundant. There's also no way to pass nested arrays so flatten is not needed.
1 parent 03c507f commit c69f55b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

templates/mod/remoteip.conf.epp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<%- |
22
String $header,
3-
Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $internal_proxy = undef,
3+
Optional[Array[Stdlib::Host]] $internal_proxy = undef,
44
Optional[Stdlib::Absolutepath] $internal_proxy_list = undef,
55
Optional[String] $proxies_header = undef,
66
Boolean $proxy_protocol = undef,
7-
Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $proxy_protocol_exceptions = undef,
7+
Optional[Array[Stdlib::Host]] $proxy_protocol_exceptions = undef,
88
Optional[Array[Stdlib::IP::Address]] $trusted_proxy = undef,
99
Optional[Stdlib::Absolutepath] $trusted_proxy_list = undef,
1010
| -%>
@@ -14,7 +14,7 @@ RemoteIPHeader <%= $header %>
1414
<%- if $internal_proxy { -%>
1515
# Declare client intranet IP addresses trusted to present
1616
# the RemoteIPHeader value
17-
<%- [$internal_proxy].flatten.each |$proxy| { -%>
17+
<%- $internal_proxy.each |$proxy| { -%>
1818
RemoteIPInternalProxy <%= $proxy %>
1919
<%- } -%>
2020
<%- } -%>
@@ -33,15 +33,15 @@ RemoteIPProxyProtocol On
3333
<%- } -%>
3434

3535
<%- if $proxy_protocol_exceptions { -%>
36-
<%- [$proxy_protocol_exceptions].flatten.each |$exception| { -%>
36+
<%- $proxy_protocol_exceptions.each |$exception| { -%>
3737
RemoteIPProxyProtocolExceptions <%= $exception %>
3838
<%- } -%>
3939
<%- } -%>
4040

4141
<%- if $trusted_proxy { -%>
4242
# Declare client intranet IP addresses trusted to present
4343
# the RemoteIPHeader value
44-
<%- [$trusted_proxy].flatten.each |$proxy| { -%>
44+
<%- $trusted_proxy.each |$proxy| { -%>
4545
RemoteIPTrustedProxy <%= $proxy %>
4646
<%- } -%>
4747
<%- } -%>

0 commit comments

Comments
 (0)