summaryrefslogtreecommitdiff
path: root/crocoite
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2017-12-23 10:04:54 +0100
committerLars-Dominik Braun <lars@6xq.net>2017-12-23 10:04:54 +0100
commitfcb9ae93514d26085c8e0aebf2fc9b9c64a77453 (patch)
treeca4498071ed1adc1df82c123f24d7c2c2d9d41b4 /crocoite
parente4120c1fad6a2ec79ff37b1a2870a0a126d3e2cb (diff)
downloadcrocoite-fcb9ae93514d26085c8e0aebf2fc9b9c64a77453.tar.gz
crocoite-fcb9ae93514d26085c8e0aebf2fc9b9c64a77453.tar.bz2
crocoite-fcb9ae93514d26085c8e0aebf2fc9b9c64a77453.zip
Set fake finished response for redirects
Fixes bcfbdd9b45b7e872ee77e1366197443d855d8c7c
Diffstat (limited to 'crocoite')
-rw-r--r--crocoite/browser.py5
1 files changed, 4 insertions, 1 deletions
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))