.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.botdetection.http_connection Namespace Reference

Functions

werkzeug.Response|None filter_request (IPv4Network|IPv6Network network, flask.Request request, config.Config cfg)
 

Detailed Description

Method ``http_connection``
--------------------------

The ``http_connection`` method evaluates a request as the request of a bot if
the Connection_ header is set to ``close``.

.. _Connection:
   https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection

Function Documentation

◆ filter_request()

werkzeug.Response | None searx.botdetection.http_connection.filter_request ( IPv4Network | IPv6Network network,
flask.Request request,
config.Config cfg )

Definition at line 28 of file http_connection.py.

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