Skip to content

Commit

Permalink
Merge pull request voxpupuli#531 from ckaenzig/optional-proxy-http-ve…
Browse files Browse the repository at this point in the history
…rsion

Allow disabling proxy_http_version directive
  • Loading branch information
3flex committed Dec 18, 2014
2 parents affa5a7 + 06e4013 commit 930f21f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 4 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
$proxy_cache_path = false,
$proxy_connect_timeout = '90',
$proxy_headers_hash_bucket_size = '64',
$proxy_http_version = '1.0',
$proxy_http_version = undef,
$proxy_read_timeout = '90',
$proxy_redirect = 'off',
$proxy_send_timeout = '90',
Expand Down Expand Up @@ -107,7 +107,9 @@
}
validate_string($multi_accept)
validate_array($proxy_set_header)
validate_string($proxy_http_version)
if ($proxy_http_version != undef) {
validate_string($proxy_http_version)
}
validate_bool($confd_purge)
validate_bool($vhost_purge)
if ($proxy_cache_path != false) {
Expand Down
6 changes: 6 additions & 0 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@
:value => '1.1',
:match => 'proxy_http_version 1.1;',
},
{
:title => 'should not set proxy_http_version',
:attr => 'proxy_http_version',
:value => nil,
:notmatch => 'proxy_http_version',
},
{
:title => 'should contain ordered appended directives',
:attr => 'proxy_set_header',
Expand Down
3 changes: 2 additions & 1 deletion templates/conf.d/proxy.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ proxy_send_timeout <%= @proxy_send_timeout %>;
proxy_read_timeout <%= @proxy_read_timeout %>;
proxy_buffers <%= @proxy_buffers %>;
proxy_buffer_size <%= @proxy_buffer_size %>;
proxy_http_version <%= @proxy_http_version %>;
<% if @proxy_http_version -%>
proxy_http_version <%= @proxy_http_version %>;<% end %>
<% @proxy_set_header.each do |header| %>
proxy_set_header <%= header %>;<% end %>
proxy_headers_hash_bucket_size <%= @proxy_headers_hash_bucket_size %>;

0 comments on commit 930f21f

Please sign in to comment.