This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new a34bcc0a return false rather than nil if RE does not match
a34bcc0a is described below
commit a34bcc0a747c8dec94ce852c9dacb325ecb39587
Author: Sebb <[email protected]>
AuthorDate: Wed Apr 10 11:09:44 2024 +0100
return false rather than nil if RE does not match
---
tools/asf-site-check.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/asf-site-check.rb b/tools/asf-site-check.rb
index 63dd3bb7..590fac39 100644
--- a/tools/asf-site-check.rb
+++ b/tools/asf-site-check.rb
@@ -56,7 +56,8 @@ module ASFDOMAIN
def self.asfhost?(host)
return true if ASF_DOMAINS.include? host
# This assumes all ASF domains are of the form a.b
- return host =~ %r{\.(\w+\.\w+)\z} && ASF_DOMAINS.include?($1)
+ # (return false rather than nil if RE does not match)
+ return (host =~ %r{\.(\w+\.\w+)\z} && ASF_DOMAINS.include?($1)) || false
end
# check if URL is known to be under ASF control
# extracts hostname and calls asfhost?