[tor-commits] [meek/master] Throw an exception if headersFn is called more than once.

dcf at torproject.org dcf at torproject.org
Wed Aug 28 05:59:18 UTC 2019


commit 89990602e8217c5f53a07c8922b5acee677e9e38
Author: David Fifield <david at bamsoftware.com>
Date:   Sat Mar 30 02:09:06 2019 -0600

    Throw an exception if headersFn is called more than once.
    
    Re-use the catch handler.
---
 webextension/browser/background.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/webextension/browser/background.js b/webextension/browser/background.js
index fd34a5d..038e548 100644
--- a/webextension/browser/background.js
+++ b/webextension/browser/background.js
@@ -168,8 +168,7 @@ async function roundtrip(params) {
         try {
             // Sanity assertion: per-request listeners are called at most once.
             if (headersCalled) {
-                console.log("headersFn called more than once");
-                return {cancel: true};
+                throw new Error("headersFn called more than once");
             }
             headersCalled = true;
 





More information about the tor-commits mailing list