This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
[mod] by default allow only HTTPS, not HTTP #2641
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR disable HTTP by default, and allows only the HTTPS protocol.
The HTTP can be explicitly enable using
enable_http: True
.Why is this change important?
The PR #2373 detects if engine use HTTP instead of HTTPS using the
request
function of each engine.But some engine send HTTP(S) requests in the
request
function:searx/searx/engines/duckduckgo_images.py
Line 40 in 0d8b369
searx/searx/engines/seznam.py
Line 26 in 0d8b369
Also, some other engines send additional request in the
response
function:searx/searx/engines/duckduckgo.py
Line 92 in 0d8b369
searx/searx/engines/pubmed.py
Line 66 in 0d8b369
This PR minimize the number of HTTP(S) requests each time searx starts (and tested too).
In addition it makes sure searx never sends HTTP request even if an engine sends more than one request (except if explicitly enabled).
How to test this PR locally?
settings.yml
, setenable_http: False
in thelibrary genesis
section.Author's checklist
Related issues
Related to