Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 80018
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: drago [...] yopmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: mirror() should decode content and accept headers arguments
Simple script to show the result when trying to mirror a file which is content-encoded. The file isn't decoded, so instead of the html file that was requested, a gzipped version is instead saved to the file. The only way to get the expected behavior is to unset accept_encoding, but because mirror doesn't accept headers as arguments, one must first save the existing value, set it globbaly to undef via the default_headers, make the request, then restore the original value. use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new(); $ua->default_header('Accept-Encoding' => scalar HTTP::Message::decodable()); $ua->mirror('http://www.yahoo.com/', '/tmp/yahoo.html');