Skip to content

Commit 48b089d

Browse files
author
tphoney
committed
(MODULES-7541) http type checks case insensitive
1 parent a01dc94 commit 48b089d

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,14 @@ false
315315

316316
#### `Stdlib::Httpsurl`
317317

318-
Matches HTTPS URLs.
318+
Matches HTTPS URLs, it is case a insensitive match.
319319

320320
Acceptable input example:
321321

322322
```shell
323323
https://hello.com
324+
325+
HTTPS://HELLO.COM
324326
```
325327

326328
Unacceptable input example:
@@ -331,14 +333,16 @@ httds://notquiteright.org`
331333

332334
#### `Stdlib::Httpurl`
333335

334-
Matches both HTTPS and HTTP URLs.
336+
Matches both HTTPS and HTTP URLs, it is a case insensitive match.
335337

336338
Acceptable input example:
337339

338340
```shell
339341
https://hello.com
340342
341343
http://hello.com
344+
345+
HTTP://HELLO.COM
342346
```
343347

344348
Unacceptable input example:

spec/type_aliases/httpsurl_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
44
describe 'Stdlib::HTTPSUrl' do
55
describe 'valid handling' do
6-
['https://hello.com', 'https://notcreative.org', 'https://notexciting.co.uk', 'https://graphemica.com/❤', 'https://graphemica.com/緩'].each do |value|
6+
['https://hello.com', 'https://notcreative.org', 'https://notexciting.co.uk', 'https://graphemica.com/❤', 'https://graphemica.com/緩', 'HTTPS://FOO.com'].each do |value|
77
describe value.inspect do
88
it { is_expected.to allow_value(value) }
99
end

spec/type_aliases/httpurl_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
44
describe 'Stdlib::HTTPUrl' do
55
describe 'valid handling' do
6-
['https://hello.com', 'https://notcreative.org', 'https://canstillaccepthttps.co.uk', 'http://anhttp.com', 'http://runningoutofideas.gov', 'http://', 'http://graphemica.com/❤',
7-
'http://graphemica.com/緩'].each do |value|
6+
['https://hello.com', 'https://notcreative.org', 'https://canstillaccepthttps.co.uk', 'http://anhttp.com', 'http://runningoutofideas.gov', 'http://', 'http://graphemica.com/❤', 'http://graphemica.com/緩', 'HTTPS://FOO.COM', 'HTTP://BAR.COM'].each do |value|
87
describe value.inspect do
98
it { is_expected.to allow_value(value) }
109
end

types/httpsurl.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
type Stdlib::HTTPSUrl = Pattern[/^https:\/\//]
1+
type Stdlib::HTTPSUrl = Pattern[/(?i:^https:\/\/)/]

types/httpurl.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
type Stdlib::HTTPUrl = Pattern[/^https?:\/\//]
1+
type Stdlib::HTTPUrl = Pattern[/(?i:^https?:\/\/)/]

0 commit comments

Comments
 (0)