Skip to content

Commit

Permalink
Simplify data types and array handling
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ekohl committed Sep 12, 2023
1 parent 03c507f commit c69f55b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions templates/mod/remoteip.conf.epp
@@ -1,10 +1,10 @@
<%- |
String $header,
Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $internal_proxy = undef,
Optional[Array[Stdlib::Host]] $internal_proxy = undef,
Optional[Stdlib::Absolutepath] $internal_proxy_list = undef,
Optional[String] $proxies_header = undef,
Boolean $proxy_protocol = undef,
Optional[Array[Variant[Stdlib::Host,Stdlib::IP::Address]]] $proxy_protocol_exceptions = undef,
Optional[Array[Stdlib::Host]] $proxy_protocol_exceptions = undef,
Optional[Array[Stdlib::IP::Address]] $trusted_proxy = undef,
Optional[Stdlib::Absolutepath] $trusted_proxy_list = undef,
| -%>
Expand All @@ -14,7 +14,7 @@ RemoteIPHeader <%= $header %>
<%- if $internal_proxy { -%>
# Declare client intranet IP addresses trusted to present
# the RemoteIPHeader value
<%- [$internal_proxy].flatten.each |$proxy| { -%>
<%- $internal_proxy.each |$proxy| { -%>
RemoteIPInternalProxy <%= $proxy %>
<%- } -%>
<%- } -%>
Expand All @@ -33,15 +33,15 @@ RemoteIPProxyProtocol On
<%- } -%>

<%- if $proxy_protocol_exceptions { -%>
<%- [$proxy_protocol_exceptions].flatten.each |$exception| { -%>
<%- $proxy_protocol_exceptions.each |$exception| { -%>
RemoteIPProxyProtocolExceptions <%= $exception %>
<%- } -%>
<%- } -%>

<%- if $trusted_proxy { -%>
# Declare client intranet IP addresses trusted to present
# the RemoteIPHeader value
<%- [$trusted_proxy].flatten.each |$proxy| { -%>
<%- $trusted_proxy.each |$proxy| { -%>
RemoteIPTrustedProxy <%= $proxy %>
<%- } -%>
<%- } -%>
Expand Down

0 comments on commit c69f55b

Please sign in to comment.