Skip to content

Commit 2817713

Browse files
committed
Simplify scriptalias template
The data type only allows an array for scriptaliases so there is no need to check for the type. It is also checked at in vhost.pp that the value is set so there's no need to repeat that logic in the template.
1 parent 3b6c262 commit 2817713

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

templates/vhost/_scriptalias.erb

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
<%- if @scriptaliases.is_a?(Array) -%>
2-
<%- aliases = @scriptaliases -%>
3-
<%- elsif @scriptaliases.is_a?(Hash) -%>
4-
<%- aliases = [@scriptaliases] -%>
5-
<%- else -%>
6-
<%- # Nothing to do with any other data type -%>
7-
<%- aliases = [] -%>
8-
<%- end -%>
9-
<%- if @scriptalias or !aliases.empty? -%>
1+
<%- aliases = @scriptaliases -%>
102
## Script alias directives
11-
<%# Combine scriptalais and scriptaliases into a single data structure -%>
3+
<%# Combine scriptalias and scriptaliases into a single data structure -%>
124
<%# for backward compatibility and ease of implementation -%>
135
<%- aliases << { 'alias' => '/cgi-bin', 'path' => @scriptalias } if @scriptalias -%>
14-
<%- aliases.flatten.compact! -%>
156
<%- aliases.each do |salias| -%>
167
<%- if salias["path"] != '' -%>
178
<%- if salias["alias"] and salias["alias"] != '' -%>
@@ -21,4 +12,3 @@
2112
<%- end -%>
2213
<%- end -%>
2314
<%- end -%>
24-
<%- end -%>

0 commit comments

Comments
 (0)