[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__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
def is_ap_requested(request: Request) -> bool:
|
def is_ap_requested(ap_request: Request) -> bool:
|
||||||
accept_str = request.headers.get("accept")
|
"""Check request accept headers."""
|
||||||
|
accept_str = ap_request.headers.get("accept")
|
||||||
if accept_str is None:
|
if accept_str is None:
|
||||||
return False
|
return False
|
||||||
for i in {
|
for i in [
|
||||||
"application/activity+json",
|
"application/activity+json",
|
||||||
"application/ld+json",
|
"application/ld+json",
|
||||||
}:
|
]:
|
||||||
if accept_str.startswith(i):
|
if accept_str.startswith(i):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue