Skip to content

Commit

Permalink
remoteip: force-cast and flatten arguments to arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
igalic committed Mar 14, 2015
1 parent e0255bd commit 12232f7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions templates/mod/remoteip.conf.erb
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Declare the header field which should be parsed for useragent IP addresses
RemoteIPHeader <%= @header %>

<%- if @proxy_ips -%>
# Declare client intranet IP addresses trusted to present
# the RemoteIPHeader value
<%- @proxy_ips.each do |proxy| -%>
<%- [@proxy_ips].flatten.each do |proxy| -%>
RemoteIPInternalProxy <%= proxy %>
<%- end -%>
<%- end -%>

# Declare the header field which will record all intermediate IP addresses
<%- if @proxies_header -%>
# Declare the header field which will record all intermediate IP addresses
RemoteIPProxiesHeader <%= @proxies_header %>
<%- end -%>

<%- if @trusted_proxy_ips -%>
# Declare client intranet IP addresses trusted to present
# the RemoteIPHeader value
<%- if @trusted_proxy_ips -%>
<%- @trusted_proxy_ips.each do |proxy| -%>
<%- [@trusted_proxy_ips].flatten.each do |proxy| -%>
RemoteIPTrustedProxy <%= proxy %>
<%- end -%>
<%- end -%>

0 comments on commit 12232f7

Please sign in to comment.