change the User Agent string
Gabor Szabo [Sun, 30 Dec 2012 20:48:13 +0000 (22:48 +0200)]
Changes
lib/XML/Feed.pm

diff --git a/Changes b/Changes
index 3870079..b8d94be 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,9 @@
+
+  * Change the User Agent to identify as XML::Feed  (SZABGAB)
+    as two sites refused to server the default user agent:
+      http://code.foo.no/feed gave 'Bad Behavior'
+      http://thorsen.pm/atom gave 'Forbidden'
+
 2012-04-10  Jakob Voss <voss@gbv.de>
 
   * Add support for RFC 5005 Feed Paging and Archiving in Atom feeds
index 8c73473..d51ab5b 100644 (file)
@@ -38,6 +38,7 @@ sub parse {
     my $xml = '';
     if (UNIVERSAL::isa($stream, 'URI')) {
         my $ua  = LWP::UserAgent->new;
+        $ua->agent(__PACKAGE__ . "/$VERSION");
         $ua->env_proxy; # force allowing of proxies
         my $res = URI::Fetch->fetch($stream, UserAgent => $ua)
             or return $class->error(URI::Fetch->errstr);