flake8 linting
This commit is contained in:
@@ -4,13 +4,14 @@ import ipaddress
|
||||
import typing
|
||||
|
||||
import quart
|
||||
from werkzeug.http import parse_list_header
|
||||
|
||||
import werkzeug
|
||||
from werkzeug.http import parse_list_header
|
||||
|
||||
from .app import app
|
||||
|
||||
|
||||
def _get_first_in_list(value_list: typing.Optional[str], allowed: typing.Sequence[str]=()) -> typing.Optional[str]:
|
||||
def _get_first_in_list(value_list: typing.Optional[str], allowed: typing.Sequence[str] = ()) -> typing.Optional[str]:
|
||||
if not value_list:
|
||||
return None
|
||||
values = parse_list_header(value_list)
|
||||
@@ -21,6 +22,8 @@ def _get_first_in_list(value_list: typing.Optional[str], allowed: typing.Sequenc
|
||||
|
||||
|
||||
def local_proxy_fix(request: quart.Request):
|
||||
if not request.remote_addr:
|
||||
return
|
||||
try:
|
||||
addr = ipaddress.ip_address(request.remote_addr)
|
||||
except ValueError:
|
||||
|
||||
Reference in New Issue
Block a user