Skip to content

Commit

Permalink
inql.burp_ext.generator_tab: catch error on missing HTTP/2 options
Browse files Browse the repository at this point in the history
HTTP/2 options may be not present in older Burp.
Catch that case before it crushes the Burp Extension.
  • Loading branch information
thypon committed May 13, 2021
1 parent 0982a34 commit f05bcd3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions inql/burp_ext/generator_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f05bcd3

Please sign in to comment.