Feature Proposal: Add User Agent to configure
Motivation
A corporate environment that has a proxy may limit the outbound web traffic to certain user agents, such as to user agent strings of common browsers. A configurable user agent in TWiki can work around this issue by setting the user agent to, say,
Mozilla/5.0.
Description and Documentation
The user agent is sent when TWiki is accessing external pages, such as via INCLUDE,
HeadlinesPlugin or the like. It is currently hard-coded to
"TWiki::Net/nnnnn libwww-perl/n.nn", where
n are digits. A new
{INCLUDE}{UserAgent} configure setting can be set to override the default.
Impact
Implementation
1. Add this documentation to TWiki.spec just below
{INCLUDE}{AllowURLs}:
# **STRING 30 EXPERT**
# Set the user agent TWiki is using when requesting external resources
# such as including URLs. Default is =TWiki/n.n.n= (current TWiki version).
$TWiki::cfg{INCLUDE}{UserAgent} = '';
2. Change TWiki::Net to use {INCLUDE}{UserAgent} setting if set, else use
TWiki/n.n.n when requesting external resources. There are two places, one with LWP, one with a direct socket connection if LWP is not installed.
I suggest to enhance trunk, as well as the TWiki 4.2 branch since it is a small and safe change. But this is the call of the release manager.
--
Contributors: PeterThoeny - 16 Dec 2008
Discussion