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

New commits:
commit 6147f454d5827dd60a926c9ee504a61d4f0cd3e4
Author:     Michael Stahl <[email protected]>
AuthorDate: Wed Apr 20 13:16:31 2022 +0200
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Tue Apr 26 10:40:27 2022 +0200

    tdf#146460 tdf#148429 ucb: webdav-curl: censor "curl" in UserAgent
    
    This is now the second bug filed because a server replies with 403 if
    the UserAgent contains the string "curl".
    
    Change-Id: I25ca2d255af76a7ff4e64dad900b1bf0b78de59f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133212
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 8d9c56e8f42428fd6695942c673bffb985d22ad5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133146
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit 3fe6a03426a86ec6b18a9b712588619f19a72897)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133275
    Reviewed-by: Thorsten Behrens <[email protected]>
    Reviewed-by: Stephan Bergmann <[email protected]>
    Tested-by: Stephan Bergmann <[email protected]>

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 813988c78489..66232a73a15f 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -620,9 +620,10 @@ 
CurlSession::CurlSession(uno::Reference<uno::XComponentContext> const& xContext,
     // 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);
+    OString const useragent(
+        OString::Concat("LibreOffice " LIBO_VERSION_DOTTED " 
denylistedbackend/")
+        + ::std::string_view(pVersion->version, strlen(pVersion->version)) + " 
"
+        + pVersion->ssl_version);
     // looks like an explicit "User-Agent" header in CURLOPT_HTTPHEADER
     // will override CURLOPT_USERAGENT, see Curl_http_useragent(), so no need
     // to check anything here

Reply via email to