aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-28 07:35:16 +0000
committerGravatar jesopo2019-11-28 07:35:16 +0000
commitc79bd6d0ba2a7bd8bd51ba65d06149b4ee7923f6 (patch)
treeb0c81045f995ef339d0370b8cb6c784bd6379f94
parent`note` should be jsonified (diff)
signature
utils.http.Response.decode() should default to detected encoding
-rw-r--r--src/utils/http.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/http.py b/src/utils/http.py
index 699c48f1..83d6523b 100644
--- a/src/utils/http.py
+++ b/src/utils/http.py
@@ -122,8 +122,8 @@ class Response(object):
self.encoding = encoding
self.headers = headers
self.cookies = cookies
- def decode(self, encoding="utf8") -> str:
- return self.data.decode(encoding)
+ def decode(self, encoding: typing.Optional[str]=None) -> str:
+ return self.data.decode(encoding or self.encoding)
def json(self) -> typing.Any:
return _json.loads(self.data)
def soup(self, parser: str="lxml") -> bs4.BeautifulSoup: