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 5a1bef15 Indent 2 spaces
5a1bef15 is described below

commit 5a1bef154415724295b071a8ffd4d7bc0eed2aa9
Author: Sebb <s...@apache.org>
AuthorDate: Fri Apr 19 23:26:11 2024 +0100

    Indent 2 spaces
---
 tools/scan-page.js | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/tools/scan-page.js b/tools/scan-page.js
index 7d184ccf..f91107ce 100755
--- a/tools/scan-page.js
+++ b/tools/scan-page.js
@@ -12,10 +12,10 @@ const inithost = new URL(target).host;
 const option = process.argv[3] || '';
 
 function isASFhost(host) {
-    return host == '' || host == 'apache.org' || host.endsWith('.apache.org') 
|| host.endsWith('.apachecon.com');
+  return host == '' || host == 'apache.org' || host.endsWith('.apache.org') || 
host.endsWith('.apachecon.com');
 }
 if (!isASFhost(inithost)) {
-    throw new Error("Only ASF hosts are supported - saw " + inithost);
+  throw new Error("Only ASF hosts are supported - saw " + inithost);
 }
 
 (async () => {
@@ -31,27 +31,27 @@ if (!isASFhost(inithost)) {
 
     const url = interceptedRequest.url();
     if (url == target) {
-        // must allow this through
-        interceptedRequest.continue();
+      // must allow this through
+      interceptedRequest.continue();
     } else {
-        let host = new URL(url).host
-        if (!isASFhost(host)) {
-            // don't visit non-ASF hosts unless requested
-            if (option == 'all') {
-                console.log(url);
-                interceptedRequest.continue();
-            } else {
-                if (option == 'showurl') {
-                  console.log(url);
-                } else {
-                  console.log(host);
-                }
-                interceptedRequest.abort();
-            }
+      let host = new URL(url).host
+      if (!isASFhost(host)) {
+        // don't visit non-ASF hosts unless requested
+        if (option == 'all') {
+          console.log(url);
+          interceptedRequest.continue();
         } else {
-            // Need to visit at least an initial redirect
-            interceptedRequest.continue();
+          if (option == 'showurl') {
+            console.log(url);
+          } else {
+            console.log(host);
+          }
+          interceptedRequest.abort();
         }
+      } else {
+        // Need to visit at least an initial redirect
+        interceptedRequest.continue();
+      }
     }
   });
   let result = await page.goto(target);

Reply via email to