Skip to content

Commit d050354

Browse files
authored
[GTK] Fix response_received events when there's no request_sent event (#1784)
For the moment, I use the following workaround: window.events.request_sent += bool
1 parent 345596c commit d050354

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

webview/platforms/gtk.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,12 @@ def on_response(self, resource, _):
365365
self.pywebview_window.events.response_received.set(response_)
366366

367367
def on_request(self, webview, resource, request):
368-
if len(self.pywebview_window.events.request_sent) == 0:
369-
return
370-
371368
if len(self.pywebview_window.events.response_received) > 0:
372369
resource.connect('notify::response', self.on_response)
373370

371+
if len(self.pywebview_window.events.request_sent) == 0:
372+
return
373+
374374
headers = request.get_http_headers()
375375
original_headers = self._headers_to_dict(headers)
376376
url = request.get_uri()

0 commit comments

Comments
 (0)