Fix URL preview bugs (type error when loading cache from db, content-type including quotes) (#4157)

This commit is contained in:
Amber Brown 2018-11-08 01:37:43 +11:00 committed by GitHub
parent c8ba79327b
commit b3708830b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 187 additions and 10 deletions

View file

@ -57,6 +57,8 @@ class FakeChannel(object):
self.result["headers"] = headers
def write(self, content):
assert isinstance(content, bytes), "Should be bytes! " + repr(content)
if "body" not in self.result:
self.result["body"] = b""