Skip to content

Commit 919c87e

Browse files
committed
Merge branch 'dev'
2 parents dc8dbe1 + 84f4f12 commit 919c87e

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ Changelog
66
Due to this library relying on external content, older versions are not guaranteed to work.
77
Try to always use the latest version.
88

9+
.. _v2.2.3:
10+
11+
2.2.3 (2019-08-17)
12+
==================
13+
14+
- Enabled client side compression
15+
916
.. _v2.2.2:
1017

1118
2.2.2 (2019-08-17)
1219
==================
1320

14-
- Fixed killed by players and palyers kill stats being inverted for ``KillStatistics``
21+
- Fixed killed by players and players kill stats being inverted for ``KillStatistics``
1522

1623
.. _v2.2.1:
1724

tibiapy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from tibiapy.creature import *
1414
from tibiapy.client import *
1515

16-
__version__ = '2.2.1'
16+
__version__ = '2.2.3'
1717

1818
from logging import NullHandler
1919

tibiapy/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def __init__(self, loop=None, session=None):
3939

4040
async def _initialize_session(self):
4141
headers = {
42-
'User-Agent ': "Tibia.py/%s (+https://github.com/Galarzaa90/tibia.py" % tibiapy.__version__
42+
'User-Agent': "Tibia.py/%s (+https://github.com/Galarzaa90/tibia.py" % tibiapy.__version__,
43+
'Accept-Encoding': "deflate, gzip"
4344
}
4445
self.session = aiohttp.ClientSession(loop=self.loop, headers=headers) # type: aiohttp.ClientSession
4546

@@ -75,7 +76,7 @@ async def _get(self, url):
7576
If there's any connection errors during the request.
7677
"""
7778
try:
78-
async with self.session.get(url) as resp:
79+
async with self.session.get(url, compress=True) as resp:
7980
self._handle_status(resp.status)
8081
return await resp.text()
8182
except aiohttp.ClientError as e:
@@ -97,7 +98,7 @@ async def _post(self, url, data):
9798
The text content of the response.
9899
"""
99100
try:
100-
async with self.session.post(url, data=data) as resp:
101+
async with self.session.post(url, data=data, compress=True) as resp:
101102
self._handle_status(resp.status)
102103
return await resp.text()
103104
except aiohttp.ClientError as e:

0 commit comments

Comments
 (0)