Skip to content

Commit

Permalink
tox -m lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibola committed Jan 10, 2024
1 parent 41240cf commit 9c8df0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion motor/aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ def _set_standard_headers(self, path, resp, gridout, checksum):

if cache_time > 0:
resp.headers["Expires"] = (
datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(seconds=cache_time)
datetime.datetime.now(datetime.timezone.utc)
+ datetime.timedelta(seconds=cache_time)
).strftime("%a, %d %b %Y %H:%M:%S GMT")

resp.headers["Cache-Control"] = "max-age=" + str(cache_time)
Expand Down
4 changes: 3 additions & 1 deletion motor/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ async def get(self, path, include_body=True):

if cache_time > 0:
self.set_header(
"Expires", datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(seconds=cache_time)
"Expires",
datetime.datetime.now(datetime.timezone.utc)
+ datetime.timedelta(seconds=cache_time),
)
self.set_header("Cache-Control", "max-age=" + str(cache_time))
else:
Expand Down

0 comments on commit 9c8df0b

Please sign in to comment.