Unverified Commit d67c679b authored by John G G's avatar John G G Committed by GitHub

Merge pull request #210 from steemit/content-encoding

Enforce http json serialization
parents 98bd9a92 b26b3bee
......@@ -2,6 +2,7 @@
import asyncio
import json
import sys
from functools import partial
from urllib.parse import urlparse
import aiohttp
......@@ -49,11 +50,12 @@ def setup_listeners(app: WebApp) -> WebApp:
logger = app.config.logger
logger.info('setup_aiohttp_session', when='before_server_start')
tcp_connector = aiohttp.TCPConnector()
aio = dict(session=aiohttp.ClientSession(
connector=tcp_connector,
skip_auto_headers=['User-Agent'],
loop=loop,
json_serialize=ujson.dumps,
json_serialize=partial(ujson.dumps, ensure_ascii=False),
headers={'Content-Type': 'application/json'}))
app.config.aiohttp = aio
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment