ucb/source/ucp/webdav/DAVResourceAccess.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit b1d18451a459e0b3d0a715fb93f8104413e804df Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Jun 12 18:17:37 2012 +0200 rhbz#678440: Always include User-Agent to avoid 403 from picky servers (cherry picked from commit 4d0e3127ed2def7212bc05aa860cd06704bb1efe, with modifications) Change-Id: I4fa7b45062b0058427f77cf9dc0abebd6b26fb49 Signed-off-by: Fridrich Å trba <fridrich.st...@bluewin.ch> diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index 11b5251..f62ddaf 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -1151,6 +1151,24 @@ void DAVResourceAccess::getUserRequestHeaders( } } } + + // 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: + for ( DAVRequestHeaders::iterator i(rRequestHeaders.begin()); + i != rRequestHeaders.end(); ++i ) + { + if ( i->first.equalsIgnoreAsciiCaseAsciiL( + RTL_CONSTASCII_STRINGPARAM( "User-Agent" ) ) ) + { + return; + } + } + rRequestHeaders.push_back( + DAVRequestHeader( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "User-Agent" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LibreOffice" ) ) ) ); } //========================================================================= commit a7a4f705904e638f0196e4fd48075bc005d0d43b Author: Fridrich Å trba <fridrich.st...@bluewin.ch> Date: Tue Jun 12 23:47:54 2012 +0200 Revert "rhbz#678440: Always include User-Agent to avoid 403 from picky servers" This reverts commit 8dfbb8793407a103ef8c5fa109f0fdf15af9262b. diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index e669245..11b5251 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -1151,21 +1151,6 @@ void DAVResourceAccess::getUserRequestHeaders( } } } - - // 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: - for ( DAVRequestHeaders::iterator i(rRequestHeaders.begin()); - i != rRequestHeaders.end(); ++i ) - { - if ( i->first.equalsIgnoreAsciiCase( "User-Agent" ) ) - { - return; - } - } - rRequestHeaders.push_back( - DAVRequestHeader( "User-Agent", "LibreOffice" ) ); } //=========================================================================
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits