[lint] fix lint
- missing-function-docstring - redefined-outer-name - use-sequence-for-iteration
This commit is contained in:
parent
35a771ac99
commit
ef2909064e
1 changed files with 5 additions and 4 deletions
9
app.py
9
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
|
||||
|
|
Loading…
Reference in a new issue