From ef2909064e38aa3fca1157014b4d32c7ec5952bf Mon Sep 17 00:00:00 2001 From: SouthFox Date: Sat, 8 Jul 2023 16:58:53 +0800 Subject: [PATCH] [lint] fix lint - missing-function-docstring - redefined-outer-name - use-sequence-for-iteration --- app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 9e2bc36..ad8f015 100644 --- a/app.py +++ b/app.py @@ -7,14 +7,15 @@ from demo import config app = Flask(__name__) -def is_ap_requested(request: Request) -> bool: - accept_str = request.headers.get("accept") +def is_ap_requested(ap_request: Request) -> bool: + """Check request accept headers.""" + accept_str = ap_request.headers.get("accept") if accept_str is None: return False - for i in { + for i in [ "application/activity+json", "application/ld+json", - }: + ]: if accept_str.startswith(i): return True return False