ucb/source/ucp/webdav-curl/CurlSession.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit d43d90347261e57b33fa932e8869184337bc0017
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Oct 6 16:29:20 2021 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 1 18:21:22 2021 +0100

    ucb: webdav-curl: add documentation from "rhbz#678440: Always ...
    
    ... include User-Agent to avoid 403 from picky servers",
    commit 4d0e3127ed2def7212bc05aa860cd06704bb1efe.
    
    Change-Id: Ie20def64b7fd1a4f523db84f42d83037bbf88856
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123176
    Tested-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 6605ffc4f9ac..6916adfa5383 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -456,6 +456,10 @@ 
CurlSession::CurlSession(uno::Reference<uno::XComponentContext> const& xContext,
              "curl version: " << pVersion->version << " " << pVersion->host
                               << " features: " << ::std::hex << 
pVersion->features << " ssl: "
                               << pVersion->ssl_version << " libz: " << 
pVersion->libz_version);
+    // Make sure a User-Agent header is always included, as at least
+    // en.wikipedia.org:80 forces back 403 "Scripts should use an informative
+    // User-Agent string with contact information, or they may be IP-blocked
+    // without notice" otherwise:
     OString const useragent(OString::Concat("LibreOffice " LIBO_VERSION_DOTTED 
" curl/")
                             + ::std::string_view(pVersion->version, 
strlen(pVersion->version)) + " "
                             + pVersion->ssl_version);

Reply via email to