From ef758913588c6421c28d01b4bb9421f48a24ba89 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 02:13:15 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/middleware/csrf.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fastapi/middleware/csrf.py b/fastapi/middleware/csrf.py index b9aefbdd0a..a1729de6f1 100644 --- a/fastapi/middleware/csrf.py +++ b/fastapi/middleware/csrf.py @@ -2,7 +2,8 @@ import functools import http.cookies import secrets from re import Pattern -from typing import Dict, List, Optional, Set, Any +from typing import Any, Dict, List, Optional, Set + from itsdangerous import BadSignature from itsdangerous.url_safe import URLSafeSerializer from starlette.datastructures import URL, MutableHeaders @@ -152,8 +153,9 @@ class CSRFMiddleware: ) def _receive_with_body(self, receive, body) -> dict: - async def inner() -> dict : + async def inner() -> dict: return {"type": "http.request", "body": body, "more_body": False} + return inner @@ -169,4 +171,5 @@ def csrf_token_processor(csrf_cookie_name: str, csrf_header_name: str): "csrf_input": csrf_input, "csrf_header": csrf_header, } - return processor \ No newline at end of file + + return processor