puppetlabs-apache icon indicating copy to clipboard operation
puppetlabs-apache copied to clipboard

Add support for all proxy schemes, not just https://

Open canth1 opened this issue 3 years ago • 2 comments

This commit fixes https://github.com/puppetlabs/puppetlabs-apache/issues/2285 by supporting all mod_proxy schemes according to the documentation here:

https://httpd.apache.org/docs/2.4/mod/mod_proxy.html

canth1 avatar Aug 10 '22 20:08 canth1

Looks like the tests fail on this.

I also wonder if this should be a type alias.

ekohl avatar Aug 12 '22 10:08 ekohl

Looks like the tests fail on this.

I also wonder if this should be a type alias.

I would agree on this

david22swan avatar Aug 15 '22 09:08 david22swan

Is it valid to not specify anything or should it be

I don't think that's correct, because I took my regex directly from Stdlib:HTTPSUrl

https://github.com/puppetlabs/puppetlabs-stdlib/blob/main/types/httpsurl.pp

Which is:

type Stdlib::HTTPSUrl = Pattern[/(?i:\Ahttps://.*\z)/]

canth1 avatar Aug 17 '22 16:08 canth1

Looks like the tests are failing.

Also, it's possible to add tests for a type alias: https://rspec-puppet.com/documentation/type_aliases/

Ok, I'll add the tests for this new type alias.

canth1 avatar Aug 17 '22 16:08 canth1

Small detail, but this looks good.

I don't think that's correct, because I took my regex directly from Stdlib:HTTPSUrl

https://github.com/puppetlabs/puppetlabs-stdlib/blob/main/types/httpsurl.pp

Which is:

type Stdlib::HTTPSUrl = Pattern[/(?i:\Ahttps://.*\z)/]

Interesting. That implies it also accepts https:// which doesn't make sense to me since I don't consider it an HTTP(S) URL.

ekohl avatar Aug 17 '22 16:08 ekohl

Small detail, but this looks good.

I don't think that's correct, because I took my regex directly from Stdlib:HTTPSUrl https://github.com/puppetlabs/puppetlabs-stdlib/blob/main/types/httpsurl.pp Which is: type Stdlib::HTTPSUrl = Pattern[/(?i:\Ahttps://.*\z)/]

Interesting. That implies it also accepts https:// which doesn't make sense to me since I don't consider it an HTTP(S) URL.

Actually, you're correct. We shouldn't allow an empty value after ://

I'll fix that with your suggestion.

It looks like the Stdlib:HTTPSUrl allows that for some reason?

canth1 avatar Aug 17 '22 16:08 canth1

It looks like the Stdlib:HTTPSUrl allows that for some reason?

Possibly an oversight and nobody ran into problems because of it.

ekohl avatar Aug 17 '22 16:08 ekohl

The spec tests are failing, but I can't figure out why?

Resource type not found: Apache::ModProxyProtocol

Not sure why it's giving me that error?

canth1 avatar Aug 17 '22 17:08 canth1

Because of https://github.com/puppetlabs/puppetlabs-apache/pull/2289#discussion_r948196017. You must name it according to the conventions so the loader finds it, so types/mod_proxy_protocol.pp.

ekohl avatar Aug 17 '22 20:08 ekohl