.oO SearXNG Developer Documentation Oo.
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
_
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Variables
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Files
File List
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
Loading...
Searching...
No Matches
http_connection.py
Go to the documentation of this file.
1
# SPDX-License-Identifier: AGPL-3.0-or-later
2
"""
3
Method ``http_connection``
4
--------------------------
5
6
The ``http_connection`` method evaluates a request as the request of a bot if
7
the Connection_ header is set to ``close``.
8
9
.. _Connection:
10
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection
11
12
"""
13
14
from
__future__
import
annotations
15
from
ipaddress
import
(
16
IPv4Network,
17
IPv6Network,
18
)
19
20
import
werkzeug
21
22
from
searx.extended_types
import
SXNG_Request
23
24
from
.
import
config
25
from
._helpers
import
too_many_requests
26
27
28
def
filter_request
(
29
network: IPv4Network | IPv6Network,
30
request: SXNG_Request,
31
cfg:
config.Config
,
# pylint: disable=unused-argument
32
) -> werkzeug.Response |
None
:
33
34
if
request.headers.get(
'Connection'
,
''
).strip() ==
'close'
:
35
return
too_many_requests(network,
"HTTP header 'Connection=close"
)
36
return
None
28
def
filter_request
(
…
searx.botdetection.config.Config
Definition
config.py:54
searx.botdetection.http_connection.filter_request
werkzeug.Response|None filter_request(IPv4Network|IPv6Network network, SXNG_Request request, config.Config cfg)
Definition
http_connection.py:32
searx.extended_types
Definition
extended_types.py:1
searxng
searx
botdetection
http_connection.py
Generated on Sat Apr 5 2025 21:19:37 for .oO SearXNG Developer Documentation Oo. by
1.13.2