mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
Fix handling non-GET requests
The `request` parameter being passed in was just a hold-over from an earlier refactoring. Added tests to ensure that this edge case keeps working.
This commit is contained in:
@@ -152,7 +152,7 @@ def cache(
|
||||
return ret
|
||||
|
||||
if request.method != "GET":
|
||||
return await ensure_async_func(request, *args, **kwargs)
|
||||
return await ensure_async_func(*args, **kwargs)
|
||||
|
||||
if_none_match = request.headers.get("if-none-match")
|
||||
if ret is not None:
|
||||
|
||||
Reference in New Issue
Block a user