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:
parent
b83bfc58eb
commit
a5fc827513
|
@ -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
|
||||
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue