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

Functions

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

Detailed Description

Method ``http_accept``
----------------------

The ``http_accept`` method evaluates a request as the request of a bot if the
Accept_ header ..

- did not contain ``text/html``

.. _Accept:
   https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept

Function Documentation

◆ filter_request()

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

Definition at line 30 of file http_accept.py.

34) -> werkzeug.Response | None:
35
36 if 'text/html' not in request.accept_mimetypes:
37 return too_many_requests(network, "HTTP header Accept did not contain text/html")
38 return None