Skip to content

Commit df6862a

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 df6862a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

manifests/mod/remoteip.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
#
5252
class apache::mod::remoteip (
5353
String $header = 'X-Forwarded-For',
54-
Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $internal_proxy = undef,
55-
Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $proxy_ips = undef,
54+
Optional[Array[Stdlib::IP::Address]] $internal_proxy = undef,
55+
Optional[Array[Stdlib::IP::Address]] $proxy_ips = undef,
5656
Optional[Stdlib::Absolutepath] $internal_proxy_list = undef,
5757
Optional[String] $proxies_header = undef,
5858
Boolean $proxy_protocol = false,
59-
Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $proxy_protocol_exceptions = undef,
59+
Optional[Array[Stdlib::IP::Address]] $proxy_protocol_exceptions = undef,
6060
Optional[Array[Stdlib::Host]] $trusted_proxy = undef,
6161
Optional[Array[Stdlib::Host]] $trusted_proxy_ips = undef,
6262
Optional[Stdlib::Absolutepath] $trusted_proxy_list = undef,

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)