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

dcf at torproject.org dcf at torproject.org
Sat Mar 30 19:36:57 UTC 2019


commit a684d5a7da79481ac1841b4e66b2b41a5fe0c88b
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 b8c5197..737c97c 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