create new tag
, view all tags

Feature Proposal: Add User Agent to configure


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.


WhatDoesItAffect: API, Vars


1. Add this documentation to TWiki.spec just below {INCLUDE}{AllowURLs}:

# 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


Topic revision: r1 - 2008-12-16 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.