1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-11-09 22:06:47 +00:00

Added rawmode support for RequestRunner.

This commit is contained in:
Markus Birth 2018-02-10 03:29:36 +01:00
parent 0d1e50abab
commit f470221989
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
2 changed files with 6 additions and 2 deletions

View File

@ -36,8 +36,11 @@ class RequestRunner:
self.server_selector.hook_prerequest() self.server_selector.hook_prerequest()
try: try:
req = http_handler.run() req = http_handler.run()
req.encoding = "utf-8" if query.rawmode:
done = query.is_done(req.status_code, req.text) done = query.is_done(req.status_code, req.content)
else:
req.encoding = "utf-8"
done = query.is_done(req.status_code, req.text)
self.server_selector.hook_postrequest(done) self.server_selector.hook_postrequest(done)
if done: if done:
return done return done

View File

@ -5,6 +5,7 @@ from . import tclresult
class TclRequest: class TclRequest:
def __init__(self): def __init__(self):
self.uri = "" self.uri = ""
self.rawmode = False
self.response = None self.response = None
self.result = None self.result = None
self.error = None self.error = None