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 787382d1 Allow for missing initiator
787382d1 is described below

commit 787382d18b42442bc918f821f01ec0842afe77c8
Author: Sebb <[email protected]>
AuthorDate: Tue Oct 21 23:47:46 2025 +0100

    Allow for missing initiator
---
 tools/scan-page.js | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/tools/scan-page.js b/tools/scan-page.js
index a6151ba3..0257a9cc 100755
--- a/tools/scan-page.js
+++ b/tools/scan-page.js
@@ -60,15 +60,19 @@ function getHost(url) {
           console.log(url);
           interceptedRequest.continue();
         } else if (option == 'allref') {
-          ini = interceptedRequest.initiator();
-          let iniurl = ini.url;
-          if (!iniurl && ini.stack) {
-            iniurl = ini.stack.callFrames[0].url;
-          }
-          if (iniurl && inithost != getHost(iniurl)) { // second level
-            console.log(url + ' <= ' + iniurl);
-          } else {
-            console.log(url);
+          let ini = interceptedRequest.initiator();
+          if (ini) {            
+            let iniurl = ini.url;
+            if (!iniurl && ini.stack) {
+              iniurl = ini.stack.callFrames[0].url;
+            }
+            if (iniurl && inithost != getHost(iniurl)) { // second level
+              console.log(url + ' <= ' + iniurl);
+            } else {
+              console.log(url);
+            }
+          } else { // seems to occur with captcha failures
+              console.log(url + ' NAK');            
           }
           interceptedRequest.continue();
         } else {

Reply via email to