Closed ReuDa closed 3 months ago
If there is an exception during setting up the rules for mitm, the mitm stays enabled blocking all traffic.
mitm
We used a wrong regular expression, for example *githubusercontent*, which leads to the following exception.
*githubusercontent*
2024-07-03T12:32:54.054Z 9a9ffda4-19ee-4be3-bb8f-d0da8791da54 ERROR Invoke Error { "errorType": "SyntaxError", "errorMessage": "Invalid regular expression: /*githubusercontent*/: Nothing to repeat", "stack": [ "SyntaxError: Invalid regular expression: /*githubusercontent*/: Nothing to repeat", " at new RegExp (<anonymous>)", " at /var/task/main.js:112:27", " at Array.forEach (<anonymous>)", " at Runtime.handler (/var/task/main.js:111:27)", " at processTicksAndRejections (node:internal/process/task_queues:96:5)" ] }
The exception happens after mitm.enable() and with this PR the mitm should be disabled via the catch block.
mitm.enable()
Lgtm!
If there is an exception during setting up the rules for
mitm
, themitm
stays enabled blocking all traffic.We used a wrong regular expression, for example
*githubusercontent*
, which leads to the following exception.The exception happens after
mitm.enable()
and with this PR themitm
should be disabled via the catch block.