From fcb9ae93514d26085c8e0aebf2fc9b9c64a77453 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 23 Dec 2017 10:04:54 +0100 Subject: Set fake finished response for redirects Fixes bcfbdd9b45b7e872ee77e1366197443d855d8c7c --- crocoite/browser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crocoite') diff --git a/crocoite/browser.py b/crocoite/browser.py index 9f0c2d0..06f2b22 100644 --- a/crocoite/browser.py +++ b/crocoite/browser.py @@ -171,10 +171,13 @@ class SiteLoader: # redirects never “finish” loading, but yield another requestWillBeSent with this key set redirectResp = kwargs.get ('redirectResponse') if redirectResp: + # create fake responses resp = {'requestId': reqId, 'response': redirectResp, 'timestamp': kwargs['timestamp']} item.setResponse (resp) + resp = {'requestId': reqId, 'encodedDataLength': 0, 'timestamp': kwargs['timestamp']} + item.setFinished (resp) self.loadingFinished (item, redirect=True) - self.logger.debug ('redirected request {} has url {}'.format (reqId, req['url'])) + self.logger.info ('redirected request {} has url {}'.format (reqId, req['url'])) else: self.logger.warn ('request {} already exists, overwriting.'.format (reqId)) -- cgit v1.2.3