diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-11-10 15:36:45 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-11-11 08:42:57 +0100 |
commit | f5926c8cfbd5af1fb7214428b4b03453b826f9a5 (patch) | |
tree | 17f50ec20fffa29b579f07745be1629017a71ae7 /lingucomponent | |
parent | 50add2043752c7b07beccef9a509bea6c09619f8 (diff) |
Move user agent initialization to InitCurl_easy
Places that didn't initialize it previously, would benefit automatically
Change-Id: I2f1ff25fc58d9378462072bc92d7b37be2370fc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159299
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'lingucomponent')
-rw-r--r-- | lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx index 45b4f9df6bdc..599bb01c6194 100644 --- a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx +++ b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx @@ -42,7 +42,7 @@ #include <algorithm> #include <string_view> -#include <curlinit.hxx> +#include <systools/curlinit.hxx> #include <sal/log.hxx> #include <tools/color.hxx> @@ -135,14 +135,6 @@ std::string makeHttpRequest_impl(std::u16string_view aURL, HTTP_METHOD method, ::InitCurl_easy(curl.get()); - // Same useragent string as in CurlSession (ucp/webdav-curl/CurlSession.cxx) - curl_version_info_data const* const pVersion(curl_version_info(CURLVERSION_NOW)); - assert(pVersion); - OString const useragent( - OString::Concat("LibreOffice " LIBO_VERSION_DOTTED " denylistedbackend/") - + pVersion->version + " " + pVersion->ssl_version); - (void)curl_easy_setopt(curl.get(), CURLOPT_USERAGENT, useragent.getStr()); - OString aURL8 = OUStringToOString(aURL, RTL_TEXTENCODING_UTF8); (void)curl_easy_setopt(curl.get(), CURLOPT_HTTPHEADER, pHttpHeader); (void)curl_easy_setopt(curl.get(), CURLOPT_FAILONERROR, 1L); |