mirror of
https://github.com/searxng/searxng.git
synced 2026-09-11 16:56:05 +00:00
fmt
This commit is contained in:
@@ -5,7 +5,6 @@ Implementations used for bot detection.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
__all__ = ["init", "dump_request", "get_network", "too_many_requests", "ProxyFix"]
|
||||
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ class Config:
|
||||
if default is UNSET:
|
||||
raise KeyError(name)
|
||||
return default
|
||||
(modulename, name) = str(fqn).rsplit('.', 1)
|
||||
modulename, name = str(fqn).rsplit('.', 1)
|
||||
m = __import__(modulename, {}, {}, [name], 0)
|
||||
return getattr(m, name)
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ Accept_ header ..
|
||||
|
||||
"""
|
||||
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
||||
@@ -14,7 +14,6 @@ bot if the Accept-Encoding_ header ..
|
||||
|
||||
"""
|
||||
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
||||
@@ -11,7 +11,6 @@ if the Accept-Language_ header is unset.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
||||
@@ -11,7 +11,6 @@ the Connection_ header is set to ``close``.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
IPv6Network,
|
||||
|
||||
@@ -20,6 +20,7 @@ Metadata`_. A request is filtered out in case of:
|
||||
|
||||
|
||||
"""
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ the User-Agent_ header is unset or matches the regular expression
|
||||
|
||||
"""
|
||||
|
||||
|
||||
import re
|
||||
from ipaddress import (
|
||||
IPv4Network,
|
||||
@@ -25,7 +24,6 @@ import flask
|
||||
from . import config
|
||||
from ._helpers import too_many_requests
|
||||
|
||||
|
||||
USER_AGENT = (
|
||||
r'('
|
||||
+ r'unknown'
|
||||
|
||||
@@ -55,7 +55,6 @@ from ._helpers import (
|
||||
logger,
|
||||
)
|
||||
|
||||
|
||||
logger = logger.getChild('ip_limit')
|
||||
|
||||
BURST_WINDOW = 20
|
||||
|
||||
@@ -23,6 +23,7 @@ The ``ip_lists`` method implements :py:obj:`block-list <block_ip>` and
|
||||
]
|
||||
|
||||
"""
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Implementation of a middleware to determine the real IP of an HTTP request
|
||||
(:py:obj:`flask.request.remote_addr`) behind a proxy chain."""
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Providing a Valkey database for the botdetection methods."""
|
||||
|
||||
|
||||
import valkey
|
||||
|
||||
__all__ = ["set_valkey_client", "get_valkey_client"]
|
||||
|
||||
Reference in New Issue
Block a user