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 f6601078 Allow shorthand for host
f6601078 is described below

commit f6601078e984a2219cb61f264ab3bd7dae5f37ee
Author: Sebb <[email protected]>
AuthorDate: Sun Jan 12 23:43:23 2025 +0000

    Allow shorthand for host
---
 www/members/page-scanner.cgi | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/www/members/page-scanner.cgi b/www/members/page-scanner.cgi
index df6af9b1..5aba8148 100755
--- a/www/members/page-scanner.cgi
+++ b/www/members/page-scanner.cgi
@@ -13,16 +13,23 @@ print "Content-type: text/plain; charset=UTF-8\r\n\r\n"
 DIVIDER=' <= '
 
 qs = ENV['QUERY_STRING']
+url = option = nil
 if qs =~ %r{^url=(https?://[^&]+)(?:&(.+))?}
   url = $1
   option = $2
+elsif qs =~ %r{^host=([a-z0-9-]+)(?:&(.+))?$}
+  url = "https://#{$1}.apache.org/";
+  option = $2
+end
+if url
   # we only want full URLs
   option = 'allref' unless %w{all showurl}.include? option
   puts <<~EOD
 
     ** ALPHA CODE **
 
-    Checking the page #{url}
+    Checking the page: #{url} 
+    Using option: #{option}
 
 
     The following references were found to hosts other than apache.org, 
openoffice.org and apachecon.com
@@ -70,6 +77,6 @@ if qs =~ %r{^url=(https?://[^&]+)(?:&(.+))?}
   end
   print "=====\n"
 else
-  print "Expecting: ?url=http://.../[&showurl]\n";
+  print "Expecting: ?url=http://.../[&showurl] (or ?host=abcd => 
?url=https://abcd.apache.org/\n";
 end
 

Reply via email to