[Libreoffice-commits] .: Branch 'libreoffice-3-5-5' - ucb/source
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Jun 18 13:02:36 PDT 2012
ucb/source/ucp/webdav/DAVResourceAccess.cxx | 15 +++++++++++++++
1 file changed, 15 insertions(+)
New commits:
commit 0c25d43ce8150b423251d9d7e84bf648c3369dae
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Jun 12 18:17:37 2012 +0200
rhbz#678440: Always include User-Agent to avoid 403 from picky servers
Change-Id: I4fa7b45062b0058427f77cf9dc0abebd6b26fb49
(cherry picked from commit 4d0e3127ed2def7212bc05aa860cd06704bb1efe)
Signed-off-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
index 11b5251..e669245 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
@@ -1151,6 +1151,21 @@ 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" ) );
}
//=========================================================================
More information about the Libreoffice-commits
mailing list