Skip to content

Commit

Permalink
Merge pull request #4 from wowkin2/wowkin2-patch-1
Browse files Browse the repository at this point in the history
Fixed: TypeError: can only join an iterable
  • Loading branch information
cr0hn committed Jul 25, 2018
2 parents 77e929c + 587f5f0 commit deec9bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aiohttp_cache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
from .middleware import *
from .exceptions import *

__version__ = "1.0.2"
__version__ = "1.0.3"

6 changes: 3 additions & 3 deletions aiohttp_cache/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ async def clear(self):
async def set(self, key: str, value: dict, expires: int = 3000):
raise NotImplementedError()

def make_key(self, request: aiohttp.web.Request) -> str:
async def make_key(self, request: aiohttp.web.Request) -> str:
key = "{method}#{host}#{path}#{postdata}#{ctype}".format(method=request.method,
path=request.rel_url.query_string,
path=request.rel_url.path_qs,
host=request.url.host,
postdata="".join(request.post()),
postdata="".join(await request.post()),
ctype=request.content_type)

return key
Expand Down
2 changes: 1 addition & 1 deletion aiohttp_cache/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def middleware_handler(request):

cache_backend = app["cache"]

key = cache_backend.make_key(request)
key = await cache_backend.make_key(request)

cached_response = await cache_backend.get(key)
if cached_response:
Expand Down

0 comments on commit deec9bb

Please sign in to comment.