ignore datacontenttype when using to_binary() (#138)

* ignore datacontenttype when using to_binary()

Signed-off-by: XinYang <xinydev@gmail.com>

* fix tests

Signed-off-by: XinYang <xinydev@gmail.com>

* fix tests. sanic>20.12 does not support py3.6 any more

Signed-off-by: XinYang <xinydev@gmail.com>
This commit is contained in:
Xin Yang 2021-06-01 21:53:47 +08:00 committed by GitHub
parent b83bfc58eb
commit a5fc827513
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -292,7 +292,7 @@ class BaseEvent(EventGetterSetter):
headers["content-type"] = self.ContentType()
props = self.Properties()
for key, value in props.items():
if key not in ["data", "extensions", "contenttype"]:
if key not in ["data", "extensions", "datacontenttype"]:
if value is not None:
headers["ce-{0}".format(key)] = value

View File

@ -34,7 +34,7 @@ async def echo(request):
v1.Event(), dict(request.headers), request.body, lambda x: x
)
hs, body = m.ToRequest(event, converters.TypeBinary, lambda x: x)
return response.text(body, headers=hs)
return response.text(body.decode("utf-8"), headers=hs)
def test_reusable_marshaller():

View File

@ -6,7 +6,7 @@ flake8-strict
pytest==4.0.0
pytest-cov==2.4.0
# web app tests
sanic
sanic==20.12.3
aiohttp
Pillow
requests