diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-08-18 15:09:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-18 18:33:27 +0200 |
commit | f88af95552f9b46e1714964d84c447327b50ed40 (patch) | |
tree | 74e49defd9b8491354be0fa46e3854373b240239 /desktop/source | |
parent | 9b30b4b1678e8be15ba51d236bd9a3e693d8d3d6 (diff) |
ucbhelper,ucb,desktop: InternetProxyServer is problematic
It turns out that every single client of InternetProxyDecider simply
concatenates the 2 members of InternetProxyServer into a single string
and passes it on to curl_easy_setopt(CURLOPT_PROXY), which will happily
take a URL including scheme and everything.
It turns out that the awful GetUnixSystemProxy() tries to cut off the
scheme in a terrible way, but GetPACProxy() does no such thing and
WINHTTP_PROXY_INFO::lpszProxy may or may not contain scheme in its
entries; fix this to only separate the port and leave the rest alone.
So why do we need a InternetProxyServer struct? Because officecfg has
separate entries that correspond to its members, and so
InternetProxyDecider gets separate events on its listener interface when
any of them changes, which is easiest to handle if it stores these
separately.
So just return a concatenated URL with or without scheme in getProxy().
Change-Id: I43c696471c8bec90667b5930fa00975adb432fe1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155840
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/app/crashreport.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index 59a2aa771b32..680492b3b80a 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -139,7 +139,7 @@ void CrashReporter::writeCommonInfo() static constexpr OUStringLiteral url = u"crashreport.libreoffice.org"; const sal_Int32 port = 443; - const ucbhelper::InternetProxyServer proxy_server = proxy_decider.getProxy(protocol, url, port); + const OUString proxy_server = proxy_decider.getProxy(protocol, url, port); // save the new Keys vmaKeyValues atlast = maKeyValues; @@ -152,9 +152,9 @@ void CrashReporter::writeCommonInfo() addKeyValue("BuildID", utl::Bootstrap::getBuildIdData(""), AddItem); addKeyValue("URL", protocol + "://" + url + "/submit/", AddItem); - if (!proxy_server.aName.isEmpty()) + if (!proxy_server.isEmpty()) { - addKeyValue("Proxy", proxy_server.aName + ":" + OUString::number(proxy_server.nPort), AddItem); + addKeyValue("Proxy", proxy_server, AddItem); } // write the new keys at the end |