Skip to content

Commit d39809a

Browse files
committed
Fix fetching through proxies
1 parent 9a36f82 commit d39809a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Changes

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Revision history for XML::Feed
44

5-
0.22
5+
0.22 2008-10-22
66
- Correct namespace for terms in RSS
77
http://rt.cpan.org/Ticket/Display.html?id=25393
88
(Kent Cowgill KCOWGILL)
@@ -18,7 +18,9 @@ Revision history for XML::Feed
1818
- Add support for GEORSS
1919
http://rt.cpan.org/Ticket/Display.html?id=39924
2020
(Scott Gifford GIFF)
21-
21+
- Fix fetching through proxies
22+
http://rt.cpan.org/Ticket/Display.html?id=36233
23+
(Trevor Vallender)
2224

2325
0.21 2008.10.15
2426
- Remove the inc directory because it's not needed anymore

lib/XML/Feed.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use strict;
66
use base qw( Class::ErrorHandler );
77
use Feed::Find;
88
use URI::Fetch;
9+
use LWP::UserAgent;
910
use Carp;
1011

1112
our $VERSION = '0.21';
@@ -30,7 +31,9 @@ sub parse {
3031
my $feed = bless {}, $class;
3132
my $xml = '';
3233
if (UNIVERSAL::isa($stream, 'URI')) {
33-
my $res = URI::Fetch->fetch($stream)
34+
my $ua = LWP::UserAgent->new;
35+
$ua->env_proxy; # force allowing of proxies
36+
my $res = URI::Fetch->fetch($stream, UserAgent => $ua)
3437
or return $class->error(URI::Fetch->errstr);
3538
return $class->error("This feed has been permanently removed")
3639
if $res->status == URI::Fetch::URI_GONE();

0 commit comments

Comments
 (0)