ItâsâŠa regex already.
In the DownloadWhiteList.txt, the value you have
http://myserver.mydomain.com:52311/Repository/.*
is already a regular expression. The â.*
â at the end means âmatch any character (.), any number of times (*)â. Thatâs why you donât have to specify the jre-8u391-windows-i586.exe in the whitelist, that whole part of the string is matched by the regex â.*
â
In the 'myserver.mydomain.com'
portion, each â.â means to match âany character, one timeâ - and in expected usage, the one character it actually matches happens to be the literal â.â. It could also match myserverXmydomain-com, or any other single character that fall in the positions of the dotsâŠbut as it is, itâs a regular expression that does work, it just allows more than intended.
Where your download is failing to match the whitelist, I agree itâs the âsâ on âhttpsâ
q: exists matches(regex("http://myserver.mydomain.com:52311/Repository/.*")) of "http://myserver.mydomain.com:52311/Repository/jre-8u391-windows-i586.exe"
A: True
T: 0.407 ms
I: singular boolean
q: exists matches(regex("http://myserver.mydomain.com:52311/Repository/.*")) of "https://myserver.mydomain.com:52311/Repository/jre-8u391-windows-i586.exe"
A: False
T: 0.296 ms
I: singular boolean
q: exists matches(regex("http://myserver.mydomain.com:52311/Repository/.*")) of "http://myserver-mydomain-com:52311/Repository/jre-8u391-windows-i586.exe"
A: True
T: 0.101 ms
I: singular boolean
For the flexibility of both âhttpâ and âhttpsâ, and the stricter checking of the hostname, the best value to use in the DownloadWhiteList.txt would be
https?://myserver\.mydomain\.com:52311/Repository/.*
The ?
on https?
makes the last character optional - it matches âhttpâ or 'httpsâ
Normall a â.
â in a regex will âmatch any single characterâ, so we escape them⊠'\.'
will only match the literal dot symbol.
/
and :
are not special symbols to regex, so we donât have to escape them.
At the end of the url, the â.*
â pattern means âmatch any characters, any number of timesâ so as long as the first part of the pattern matches, your URLs can end with anything.
Also, I did recently encounter an issue that these are case-sensitive regular expressions. These examples wonât match HTTP://MyServer.MyDomain.Com:52311/repository/java.exe