From f05bcd3a2aaf5d823ec50a727fc3d97e36d788f3 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Thu, 13 May 2021 16:13:27 +0200 Subject: [PATCH] inql.burp_ext.generator_tab: catch error on missing HTTP/2 options HTTP/2 options may be not present in older Burp. Catch that case before it crushes the Burp Extension. --- inql/burp_ext/generator_tab.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/inql/burp_ext/generator_tab.py b/inql/burp_ext/generator_tab.py index 81502cd..2bab8e8 100644 --- a/inql/burp_ext/generator_tab.py +++ b/inql/burp_ext/generator_tab.py @@ -93,10 +93,13 @@ def getUiComponent(self): return self.panel.this def disable_http2(self): - print("Jython does not support HTTP/2 at the current stage: disabling it!") - j = json.loads(self._callbacks.saveConfigAsJson()) - j['project_options']['http']['http2']['enable_http2'] = False - self._callbacks.loadConfigFromJson(json.dumps(j)) + try: + print("Jython does not support HTTP/2 at the current stage: disabling it!") + j = json.loads(self._callbacks.saveConfigAsJson()) + j['project_options']['http']['http2']['enable_http2'] = False + self._callbacks.loadConfigFromJson(json.dumps(j)) + except Exception as ex: + print("Cannot disable HTTP/2! %s" % ex) def bring_in_front(self): self.panel.this.setAlwaysOnTop(True)