Skip to content

Commit 9c924e9

Browse files
committedJun 15, 2021
inql.*: stop GraphiQL server on extension unload
- inql.actions.sendto: stop server included in this class - inql.burp_ext.generator_tab: forward a stop message to the http_mutator included in the tab - inql.burp_ext.extender: forward a stop message to the generator_tab on extension unload
1 parent f05bcd3 commit 9c924e9

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed
 

‎inql/actions/sendto.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,8 @@ def send_to_graphiql(self, host, payload):
155155
URLOpener().open(self.get_graphiql_target(
156156
self._server.server_port, host,
157157
content['query'] if 'query' in content else None,
158-
content['variables'] if 'variables' in content else None))
158+
content['variables'] if 'variables' in content else None))
159+
160+
def stop(self):
161+
self._server.shutdown()
162+
self._server.socket.close()

‎inql/burp_ext/extender.py

+1
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@ def extensionUnloaded(self):
5757
shutil.rmtree(self._tmpdir, ignore_errors=False, onerror=None)
5858
stop()
5959
self._tab.save()
60+
self._tab.stop()

‎inql/burp_ext/generator_tab.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def getUiComponent(self):
5050

5151
http_mutator = HTTPMutator(
5252
callbacks=self._callbacks, helpers=self._helpers, overrideheaders=overrideheaders)
53+
self.http_mutator = http_mutator
5354

5455
repeater_sender = SendToAction(omnimenu=repeater_omnimenu, has_host=http_mutator.has_host,
5556
send_to=http_mutator.send_to_repeater)
@@ -113,4 +114,7 @@ def save(self):
113114
try:
114115
self._callbacks.saveExtensionSetting(self.panel.__class__.__name__, self.panel.state())
115116
except:
116-
print("Cannot save state!")
117+
print("Cannot save state!")
118+
119+
def stop(self):
120+
self.http_mutator.stop()

0 commit comments

Comments
 (0)
Please sign in to comment.