Skip to content

Commit 92c47e1

Browse files
authored
(GH-2285) Add support for all proxy schemes, not just https://
This commit fixes GH-2285 by supporting all mod_proxy schemes according to the documentation here: https://httpd.apache.org/docs/2.4/mod/mod_proxy.html Type alias `modproxyprotocol` created in order to keep the code neat.
1 parent babf023 commit 92c47e1

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

manifests/balancermember.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#
4141
define apache::balancermember (
4242
String $balancer_cluster,
43-
Stdlib::HTTPUrl $url = "http://${$facts['networking']['fqdn']}/",
43+
Apache::ModProxyProtocol $url = "http://${$facts['networking']['fqdn']}/",
4444
Array $options = [],
4545
) {
4646
concat::fragment { "BalancerMember ${name}":

spec/type_aliases/modproxy_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require 'spec_helper'
2+
3+
describe 'Apache::ModProxyProtocol' do
4+
[
5+
'ajp://www.example.com',
6+
'fcgi://www.example.com',
7+
'ftp://www.example.com',
8+
'h2://www.example.com',
9+
'h2c://www.example.com',
10+
'http://www.example.com',
11+
'https://www.example.com',
12+
'scgi://www.example.com',
13+
'uwsgi://www.example.com',
14+
'ws://www.example.com',
15+
'wss://www.example.com',
16+
'unix:/path/to/unix.socket',
17+
].each do |allowed_value|
18+
it { is_expected.to allow_value(allowed_value) }
19+
end
20+
end

types/modproxyprotocol.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @summary Supported protocols / schemes by mod_proxy
2+
# @see https://httpd.apache.org/docs/2.4/mod/mod_proxy.html
3+
type Apache::ModProxyProtocol = Pattern[/(\A(ajp|fcgi|ftp|h2c?|https?|scgi|uwsgi|wss?):\/\/.+\z)/, /(\Aunix:\/([^\n\/\0]+\/*)*\z)/]

0 commit comments

Comments
 (0)