diff --git a/src/engines/bing.rs b/src/engines/bing.rs index ec582e4..50cf048 100644 --- a/src/engines/bing.rs +++ b/src/engines/bing.rs @@ -79,13 +79,13 @@ impl SearchEngine for Bing { } let header_map = HeaderMap::try_from(&HashMap::from([ - ("USER_AGENT".to_string(), user_agent.to_string()), - ("REFERER".to_string(), "https://google.com/".to_string()), + ("User-Agent".to_string(), user_agent.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(), ), - ("COOKIE".to_string(), cookie_string), + ("Cookie".to_string(), cookie_string), ])) .change_context(EngineError::UnexpectedError)?; diff --git a/src/engines/brave.rs b/src/engines/brave.rs index 65067fc..e135c36 100644 --- a/src/engines/brave.rs +++ b/src/engines/brave.rs @@ -54,14 +54,14 @@ impl SearchEngine for Brave { }; 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(), ), - ("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}"), ), ])) diff --git a/src/engines/duckduckgo.rs b/src/engines/duckduckgo.rs index 02ee481..b109624 100644 --- a/src/engines/duckduckgo.rs +++ b/src/engines/duckduckgo.rs @@ -65,13 +65,13 @@ impl SearchEngine for DuckDuckGo { // initializing HeaderMap and adding appropriate headers. let header_map = HeaderMap::try_from(&HashMap::from([ - ("USER_AGENT".to_string(), user_agent.to_string()), - ("REFERER".to_string(), "https://google.com/".to_string()), + ("User-Agent".to_string(), user_agent.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(), ), - ("COOKIE".to_string(), "kl=wt-wt".to_string()), + ("Cookie".to_string(), "kl=wt-wt".to_string()), ])) .change_context(EngineError::UnexpectedError)?; diff --git a/src/engines/librex.rs b/src/engines/librex.rs index 69e4611..840e8f4 100644 --- a/src/engines/librex.rs +++ b/src/engines/librex.rs @@ -72,11 +72,11 @@ impl SearchEngine for LibreX { // initializing HeaderMap and adding appropriate headers. let header_map = HeaderMap::try_from(&HashMap::from([ - ("USER_AGENT".to_string(), user_agent.to_string()), - ("REFERER".to_string(), "https://google.com/".to_string()), - ("CONTENT_TYPE".to_string(), "application/x-www-form-urlencoded".to_string()), + ("User-Agent".to_string(), user_agent.to_string()), + ("Referer".to_string(), "https://google.com/".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(), ), ])) diff --git a/src/engines/mojeek.rs b/src/engines/mojeek.rs index e376828..d3b13b6 100644 --- a/src/engines/mojeek.rs +++ b/src/engines/mojeek.rs @@ -129,13 +129,13 @@ impl SearchEngine for Mojeek { } let header_map = HeaderMap::try_from(&HashMap::from([ - ("USER_AGENT".to_string(), user_agent.to_string()), - ("REFERER".to_string(), "https://google.com/".to_string()), + ("User-Agent".to_string(), user_agent.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(), ), - ("COOKIE".to_string(), cookie_string), + ("Cookie".to_string(), cookie_string), ])) .change_context(EngineError::UnexpectedError)?; diff --git a/src/engines/searx.rs b/src/engines/searx.rs index df96857..a1fb6c7 100644 --- a/src/engines/searx.rs +++ b/src/engines/searx.rs @@ -66,10 +66,10 @@ impl SearchEngine for Searx { // initializing headers and adding appropriate headers. let header_map = HeaderMap::try_from(&HashMap::from([ - ("USER_AGENT".to_string(), user_agent.to_string()), - ("REFERER".to_string(), "https://google.com/".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()) + ("User-Agent".to_string(), user_agent.to_string()), + ("Referer".to_string(), "https://google.com/".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()) ])) .change_context(EngineError::UnexpectedError)?; diff --git a/src/engines/startpage.rs b/src/engines/startpage.rs index 97b7a40..b3a28d0 100644 --- a/src/engines/startpage.rs +++ b/src/engines/startpage.rs @@ -57,13 +57,13 @@ impl SearchEngine for Startpage { // initializing HeaderMap and adding appropriate headers. let header_map = HeaderMap::try_from(&HashMap::from([ - ("USER_AGENT".to_string(), user_agent.to_string()), - ("REFERER".to_string(), "https://google.com/".to_string()), + ("User-Agent".to_string(), user_agent.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(), ), - ("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)?;