From dc53ca18f2bbbfe93be2786680f3afe1bd24afea Mon Sep 17 00:00:00 2001 From: Tuomas Jormola Date: Thu, 30 Jan 2014 14:41:55 +0200 Subject: Bug#737121: ikiwiki: [PATCH] Implement configuration option to set the user agent string for outbound HTTP requests Package: ikiwiki Version: 3.20140125 Severity: wishlist By default, LWP::UserAgent used by IkiWiki to perform outbound HTTP requests sends the string "libwww-perl/" as User-Agent header in HTTP requests. Some blogging platforms have blacklisted the user agent and won't serve any content for clients using this user agent string. With IkiWiki configuration option "useragent" it's now possible to define a custom string that is used for the value of the User-Agent header. --- IkiWiki.pm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'IkiWiki.pm') diff --git a/IkiWiki.pm b/IkiWiki.pm index b7080bb0b..eb480969b 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -527,6 +527,14 @@ sub getsetup () { safe => 0, # hooks into perl module internals rebuild => 0, }, + useragent => { + type => "string", + default => undef, + example => "Wget/1.13.4 (linux-gnu)", + description => "set custom user agent string for outbound HTTP requests e.g. when fetching aggregated RSS feeds", + safe => 0, + rebuild => 0, + }, } sub defaultconfig () { @@ -2301,6 +2309,7 @@ sub useragent () { return LWP::UserAgent->new( cookie_jar => $config{cookiejar}, env_proxy => 1, # respect proxy env vars + agent => $config{useragent}, ); } -- cgit v1.2.3