.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 29 of file http_accept.py.

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