Skip to content

Commit

Permalink
Merge pull request puppetlabs#1984 from oxc/fix_directory_proxy_params
Browse files Browse the repository at this point in the history
Fix newline being added before proxy params
  • Loading branch information
sheenaajay authored Dec 11, 2019
2 parents 646fa9d + 287a2ba commit 5c01852
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,20 @@
'provider' => 'location',
'auth_ldap_referrals' => 'off',
},
{
'path' => '/proxy',
'provider' => 'location',
'proxy_pass' => [
{
'url' => 'http://backend-b/',
'keywords' => ['noquery', 'interpolate'],
'params' => {
'retry' => '0',
'timeout' => '5',
},
},
],
},
{
'path' => '/var/www/node-app/public',
'passenger_enabled' => true,
Expand Down Expand Up @@ -611,6 +625,11 @@
content: %r{^\s+LDAPReferrals off$},
)
}
it {
is_expected.to contain_concat__fragment('rspec.example.com-directories').with(
content: %r{^\s+ProxyPass http://backend-b/ retry=0 timeout=5 noquery interpolate$},
)
}
it {
is_expected.to contain_concat__fragment('rspec.example.com-directories').with(
content: %r{^\s+Options\sIndexes\sFollowSymLinks\sMultiViews$},
Expand Down
2 changes: 1 addition & 1 deletion templates/vhost/_directories.erb
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@
<%- end -%>
<%- if directory['proxy_pass'] and directory['provider'] and directory['provider'].match('location') -%>
<%- directory['proxy_pass'].flatten.compact.each do |proxy| -%>
ProxyPass <%= proxy['url'] %>
ProxyPass <%= proxy['url'] -%>
<%- if proxy['params'] -%>
<%- proxy['params'].keys.sort.each do |key| -%> <%= key %>=<%= proxy['params'][key] -%>
<%- end -%>
Expand Down

0 comments on commit 5c01852

Please sign in to comment.