|
99 | 99 | $http_response_status410_rules_real = concat($http_response_rules, 'set-status 410 if { var(txn.status410) -m bool }') |
100 | 100 | } |
101 | 101 | if 'canonicals' in $http_edge_services and 'status410' in $http_edge_services { |
102 | | - $http_response_rules_real = deep_merge($http_response_canonicals_rules_real, $http_response_status410_rules_real) |
| 102 | + $http_response_rules_real_placeholder = concat($http_response_canonicals_rules_real, $http_response_status410_rules_real) |
| 103 | + $http_response_rules_real = unique($http_response_rules_real_placeholder) |
103 | 104 | } elsif 'canonicals' in $http_edge_services { |
104 | 105 | $http_response_rules_real = $http_response_canonicals_rules_real |
105 | 106 | } else { |
|
113 | 114 | if 'redirects' in $http_edge_services and grep($http_request_rules, $http_edge_markers['redirects']) == [] { |
114 | 115 | $http_request_rules_with_redirects = concat($http_request_rules, $http_edge_rules_all_real['redirects']) |
115 | 116 | } |
116 | | - else { |
| 117 | + elsif 'redirects' in $http_edge_services { |
117 | 118 | $http_request_rules_with_redirects = split(regsubst(join($http_request_rules, "\n"), $http_edge_markers['redirects'], join($http_edge_rules_all_real['redirects'], "\n")), "\n") |
| 119 | + } else { |
| 120 | + $http_request_rules_with_redirects = $http_request_rules |
118 | 121 | } |
119 | 122 |
|
120 | 123 | if 'status410' in $http_edge_services and grep($http_request_rules_with_redirects, $http_edge_markers['status410']) == [] { |
121 | 124 | $http_request_rules_with_status410 = concat($http_request_rules_with_redirects, $http_edge_rules_all_real['status410']) |
122 | 125 | } |
123 | | - else { |
| 126 | + elsif 'status410' in $http_edge_services { |
124 | 127 | $http_request_rules_with_status410 = split(regsubst(join($http_request_rules_with_redirects, "\n"), $http_edge_markers['status410'], join($http_edge_rules_all_real['status410'], "\n")), "\n") |
| 128 | + } else { |
| 129 | + $http_request_rules_with_status410 = $http_request_rules_with_redirects |
125 | 130 | } |
126 | 131 |
|
127 | 132 | if 'nofollow' in $http_edge_services and grep($http_request_rules_with_status410, $http_edge_markers['nofollow']) == [] { |
128 | 133 | $http_request_rules_with_nofollow = concat($http_request_rules_with_status410, $http_edge_rules_all_real['nofollow']) |
129 | 134 | } |
130 | | - else { |
| 135 | + elsif 'nofollow' in $http_edge_services { |
131 | 136 | $http_request_rules_with_nofollow = split(regsubst(join($http_request_rules_with_status410, "\n"), $http_edge_markers['nofollow'], join($http_edge_rules_all_real['nofollow'], "\n")), "\n") |
| 137 | + } else { |
| 138 | + $http_request_rules_with_nofollow = $http_request_rules_with_status410 |
132 | 139 | } |
133 | 140 |
|
134 | 141 | if 'canonicals' in $http_edge_services and grep($http_request_rules_with_nofollow, $http_edge_markers['canonicals']) == [] { |
135 | 142 | $http_request_rules_real = concat($http_request_rules_with_nofollow, $http_edge_canonicals_rules_real) |
136 | 143 | } |
137 | | - else { |
| 144 | + elsif 'canonicals' in $http_edge_services { |
138 | 145 | $http_request_rules_real = split(regsubst(join($http_request_rules_with_nofollow, "\n"), $http_edge_markers['canonicals'], join($http_edge_canonicals_rules_real, "\n")), "\n") |
| 146 | + } else { |
| 147 | + $http_request_rules_real = $http_request_rules_with_nofollow |
139 | 148 | } |
140 | 149 |
|
141 | 150 | $http_request_rules_hash = {$http_edge_frontend => {'options' => {'http-request' => $http_request_rules_real}}} |
142 | | - $frontends_real = deep_merge($ducktape::haproxy::frontends, $http_request_rules_hash) |
143 | | - if 'canonicals' in $http_edge_services { |
| 151 | + if 'canonicals' in $http_edge_services or 'status410' in $http_edge_services { |
144 | 152 | $frontends_real_placeholder = deep_merge($ducktape::haproxy::frontends, $http_request_rules_hash) |
145 | 153 | $frontends_real = deep_merge($frontends_real_placeholder, $http_response_rules_hash) |
146 | 154 | } else { |
|
0 commit comments