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 561ab34d Allow showurl option
561ab34d is described below

commit 561ab34dab9ac3d4b0c2f28ef6f1fb6e91ae6c35
Author: Sebb <s...@apache.org>
AuthorDate: Fri Apr 19 22:52:39 2024 +0100

    Allow showurl option
---
 www/members/page-scanner.cgi | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/www/members/page-scanner.cgi b/www/members/page-scanner.cgi
index 276d3ec9..0df899c8 100755
--- a/www/members/page-scanner.cgi
+++ b/www/members/page-scanner.cgi
@@ -12,14 +12,17 @@ print "Content-type: text/plain; charset=UTF-8\r\n\r\n"
 
 # puts ENV['REQUEST_URI']
 qs = ENV['QUERY_STRING']
-if qs =~ %r{^url=(https?://.+)}
+if qs =~ %r{^url=(https?://[^&]+)(?:&(.+))?}
   url = $1
+  option = $2
+  # we only want full URLs
+  option = 'all' unless option == 'showurl'
   print "Checking the page #{url}\n\n"
   puts "The following references were found to hosts other than apache.org and 
apachecon.com"
   puts "The first column shows if the host is recognised as being under ASF 
control according to"
   puts "https://privacy.apache.org/policies/asf-domains";
   print "=====\n"
-  cmd = ['node', '/srv/whimsy/tools/scan-page.js', url, 'all']
+  cmd = ['node', '/srv/whimsy/tools/scan-page.js', url, option]
   out, err, status = Open3.capture3(*cmd)
   if status.success?
     out.split("\n").each do |url|
@@ -31,6 +34,6 @@ if qs =~ %r{^url=(https?://.+)}
   end
   print "=====\n"
 else
-  print "Expecting: ?url=http://.../\n";
+  print "Expecting: ?url=http://.../[&showurl]\n";
 end
 

Reply via email to