0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-11-23 06:28:23 -05:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Kekma
e2527a671f
Merge 4e76d3b484 into 93fd8f8565 2024-04-25 17:32:28 +00:00
Todor Todorov
93fd8f8565
🎨 style: change http/https header word/sentence casing (#555)
Currently all HTTP request headers are in snake case and upper case.
The adopted standard is kebab case and title case.

Here you will find more details:
https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Standard_request_fields
2024-04-25 20:31:47 +03:00
neon_arch
4e76d3b484
Merge branch 'rolling' into 532 2024-04-07 15:35:58 +03:00
KekmaTime
7553616649 🔧 Config: Updated number_of_https_connections for the HTTPS connection pool. 2024-03-31 17:59:24 +05:30
8 changed files with 29 additions and 30 deletions

View File

@ -79,13 +79,13 @@ impl SearchEngine for Bing {
} }
let header_map = HeaderMap::try_from(&HashMap::from([ let header_map = HeaderMap::try_from(&HashMap::from([
("USER_AGENT".to_string(), user_agent.to_string()), ("User-Agent".to_string(), user_agent.to_string()),
("REFERER".to_string(), "https://google.com/".to_string()), ("Referer".to_string(), "https://google.com/".to_string()),
( (
"CONTENT_TYPE".to_string(), "Content-Type".to_string(),
"application/x-www-form-urlencoded".to_string(), "application/x-www-form-urlencoded".to_string(),
), ),
("COOKIE".to_string(), cookie_string), ("Cookie".to_string(), cookie_string),
])) ]))
.change_context(EngineError::UnexpectedError)?; .change_context(EngineError::UnexpectedError)?;

View File

@ -54,14 +54,14 @@ impl SearchEngine for Brave {
}; };
let header_map = HeaderMap::try_from(&HashMap::from([ let header_map = HeaderMap::try_from(&HashMap::from([
("USER_AGENT".to_string(), user_agent.to_string()), ("User-Agent".to_string(), user_agent.to_string()),
( (
"CONTENT_TYPE".to_string(), "Content-Type".to_string(),
"application/x-www-form-urlencoded".to_string(), "application/x-www-form-urlencoded".to_string(),
), ),
("REFERER".to_string(), "https://google.com/".to_string()), ("Referer".to_string(), "https://google.com/".to_string()),
( (
"COOKIE".to_string(), "Cookie".to_string(),
format!("safe_search={safe_search_level}"), format!("safe_search={safe_search_level}"),
), ),
])) ]))

View File

@ -65,13 +65,13 @@ impl SearchEngine for DuckDuckGo {
// initializing HeaderMap and adding appropriate headers. // initializing HeaderMap and adding appropriate headers.
let header_map = HeaderMap::try_from(&HashMap::from([ let header_map = HeaderMap::try_from(&HashMap::from([
("USER_AGENT".to_string(), user_agent.to_string()), ("User-Agent".to_string(), user_agent.to_string()),
("REFERER".to_string(), "https://google.com/".to_string()), ("Referer".to_string(), "https://google.com/".to_string()),
( (
"CONTENT_TYPE".to_string(), "Content-Type".to_string(),
"application/x-www-form-urlencoded".to_string(), "application/x-www-form-urlencoded".to_string(),
), ),
("COOKIE".to_string(), "kl=wt-wt".to_string()), ("Cookie".to_string(), "kl=wt-wt".to_string()),
])) ]))
.change_context(EngineError::UnexpectedError)?; .change_context(EngineError::UnexpectedError)?;

View File

@ -72,11 +72,11 @@ impl SearchEngine for LibreX {
// initializing HeaderMap and adding appropriate headers. // initializing HeaderMap and adding appropriate headers.
let header_map = HeaderMap::try_from(&HashMap::from([ let header_map = HeaderMap::try_from(&HashMap::from([
("USER_AGENT".to_string(), user_agent.to_string()), ("User-Agent".to_string(), user_agent.to_string()),
("REFERER".to_string(), "https://google.com/".to_string()), ("Referer".to_string(), "https://google.com/".to_string()),
("CONTENT_TYPE".to_string(), "application/x-www-form-urlencoded".to_string()), ("Content-Type".to_string(), "application/x-www-form-urlencoded".to_string()),
( (
"COOKIE".to_string(), "Cookie".to_string(),
"theme=amoled; disable_special=on; disable_frontends=on; language=en; number_of_results=10; safe_search=on; save=1".to_string(), "theme=amoled; disable_special=on; disable_frontends=on; language=en; number_of_results=10; safe_search=on; save=1".to_string(),
), ),
])) ]))

View File

@ -129,13 +129,13 @@ impl SearchEngine for Mojeek {
} }
let header_map = HeaderMap::try_from(&HashMap::from([ let header_map = HeaderMap::try_from(&HashMap::from([
("USER_AGENT".to_string(), user_agent.to_string()), ("User-Agent".to_string(), user_agent.to_string()),
("REFERER".to_string(), "https://google.com/".to_string()), ("Referer".to_string(), "https://google.com/".to_string()),
( (
"CONTENT_TYPE".to_string(), "Content-Type".to_string(),
"application/x-www-form-urlencoded".to_string(), "application/x-www-form-urlencoded".to_string(),
), ),
("COOKIE".to_string(), cookie_string), ("Cookie".to_string(), cookie_string),
])) ]))
.change_context(EngineError::UnexpectedError)?; .change_context(EngineError::UnexpectedError)?;

View File

@ -66,10 +66,10 @@ impl SearchEngine for Searx {
// initializing headers and adding appropriate headers. // initializing headers and adding appropriate headers.
let header_map = HeaderMap::try_from(&HashMap::from([ let header_map = HeaderMap::try_from(&HashMap::from([
("USER_AGENT".to_string(), user_agent.to_string()), ("User-Agent".to_string(), user_agent.to_string()),
("REFERER".to_string(), "https://google.com/".to_string()), ("Referer".to_string(), "https://google.com/".to_string()),
("CONTENT_TYPE".to_string(), "application/x-www-form-urlencoded".to_string()), ("Content-Type".to_string(), "application/x-www-form-urlencoded".to_string()),
("COOKIE".to_string(), "categories=general; language=auto; locale=en; autocomplete=duckduckgo; image_proxy=1; method=POST; safesearch=2; theme=simple; results_on_new_tab=1; doi_resolver=oadoi.org; simple_style=auto; center_alignment=1; query_in_title=1; infinite_scroll=0; disabled_engines=; enabled_engines=\"archive is__general\\054yep__general\\054curlie__general\\054currency__general\\054ddg definitions__general\\054wikidata__general\\054duckduckgo__general\\054tineye__general\\054lingva__general\\054startpage__general\\054yahoo__general\\054wiby__general\\054marginalia__general\\054alexandria__general\\054wikibooks__general\\054wikiquote__general\\054wikisource__general\\054wikiversity__general\\054wikivoyage__general\\054dictzone__general\\054seznam__general\\054mojeek__general\\054naver__general\\054wikimini__general\\054brave__general\\054petalsearch__general\\054goo__general\"; disabled_plugins=; enabled_plugins=\"searx.plugins.hostname_replace\\054searx.plugins.oa_doi_rewrite\\054searx.plugins.vim_hotkeys\"; tokens=; maintab=on; enginetab=on".to_string()) ("Cookie".to_string(), "categories=general; language=auto; locale=en; autocomplete=duckduckgo; image_proxy=1; method=POST; safesearch=2; theme=simple; results_on_new_tab=1; doi_resolver=oadoi.org; simple_style=auto; center_alignment=1; query_in_title=1; infinite_scroll=0; disabled_engines=; enabled_engines=\"archive is__general\\054yep__general\\054curlie__general\\054currency__general\\054ddg definitions__general\\054wikidata__general\\054duckduckgo__general\\054tineye__general\\054lingva__general\\054startpage__general\\054yahoo__general\\054wiby__general\\054marginalia__general\\054alexandria__general\\054wikibooks__general\\054wikiquote__general\\054wikisource__general\\054wikiversity__general\\054wikivoyage__general\\054dictzone__general\\054seznam__general\\054mojeek__general\\054naver__general\\054wikimini__general\\054brave__general\\054petalsearch__general\\054goo__general\"; disabled_plugins=; enabled_plugins=\"searx.plugins.hostname_replace\\054searx.plugins.oa_doi_rewrite\\054searx.plugins.vim_hotkeys\"; tokens=; maintab=on; enginetab=on".to_string())
])) ]))
.change_context(EngineError::UnexpectedError)?; .change_context(EngineError::UnexpectedError)?;

View File

@ -57,13 +57,13 @@ impl SearchEngine for Startpage {
// initializing HeaderMap and adding appropriate headers. // initializing HeaderMap and adding appropriate headers.
let header_map = HeaderMap::try_from(&HashMap::from([ let header_map = HeaderMap::try_from(&HashMap::from([
("USER_AGENT".to_string(), user_agent.to_string()), ("User-Agent".to_string(), user_agent.to_string()),
("REFERER".to_string(), "https://google.com/".to_string()), ("Referer".to_string(), "https://google.com/".to_string()),
( (
"CONTENT_TYPE".to_string(), "Content-Type".to_string(),
"application/x-www-form-urlencoded".to_string(), "application/x-www-form-urlencoded".to_string(),
), ),
("COOKIE".to_string(), "preferences=connect_to_serverEEE0N1Ndate_timeEEEworldN1Ndisable_family_filterEEE0N1Ndisable_open_in_new_windowEEE0N1Nenable_post_methodEEE1N1Nenable_proxy_safety_suggestEEE1N1Nenable_stay_controlEEE0N1Ninstant_answersEEE1N1Nlang_homepageEEEs%2Fnight%2FenN1NlanguageEEEenglishN1Nlanguage_uiEEEenglishN1Nnum_of_resultsEEE10N1Nsearch_results_regionEEEallN1NsuggestionsEEE1N1Nwt_unitEEEcelsius".to_string()), ("Cookie".to_string(), "preferences=connect_to_serverEEE0N1Ndate_timeEEEworldN1Ndisable_family_filterEEE0N1Ndisable_open_in_new_windowEEE0N1Nenable_post_methodEEE1N1Nenable_proxy_safety_suggestEEE1N1Nenable_stay_controlEEE0N1Ninstant_answersEEE1N1Nlang_homepageEEEs%2Fnight%2FenN1NlanguageEEEenglishN1Nlanguage_uiEEEenglishN1Nnum_of_resultsEEE10N1Nsearch_results_regionEEEallN1NsuggestionsEEE1N1Nwt_unitEEEcelsius".to_string()),
])) ]))
.change_context(EngineError::UnexpectedError)?; .change_context(EngineError::UnexpectedError)?;

View File

@ -16,9 +16,8 @@ rate_limiter = {
number_of_requests = 20, -- The number of request that are allowed within a provided time limit. number_of_requests = 20, -- The number of request that are allowed within a provided time limit.
time_limit = 3, -- The time limit in which the quantity of requests that should be accepted. time_limit = 3, -- The time limit in which the quantity of requests that should be accepted.
} }
-- Set whether the server will use an adaptive/dynamic HTTPS window size, see https://httpwg.org/specs/rfc9113.html#fc-principles
https_adaptive_window_size = false https_adaptive_window_size = false
number_of_https_connections = 10 -- the number of https connections that should be available in the connection pool.
-- ### Search ### -- ### Search ###
-- Filter results based on different levels. The levels provided are: -- Filter results based on different levels. The levels provided are:
-- {{ -- {{