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

Owner: Nobody in particular
Requestors: drago [...]

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

Subject: mirror() should decode content and accept headers arguments
Download (untitled) / with headers
text/plain 688b
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('', '/tmp/yahoo.html');

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to