libwww-perl / WWW-Mechanize

Handy web browsing in a Perl object
https://metacpan.org/pod/WWW::Mechanize
Other
68 stars 53 forks source link

setting max_size returns nonsense for content #213

Closed spazm closed 6 years ago

spazm commented 7 years ago

violapir...@gmail.com reported on Jun 12, 2012

What steps will reproduce the problem?
1. $mech->max_size(1024);
2. $mech->get($url);
3. print $mech->content;

Since this is a subclass of LWP::UserAgent, what should be shown is all of the content up until it hit (approximately) 1024 bytes. However, instead what is shown is something like this:

?|???-???+"?O<?p}?,?ܙmW ?`E??\\ސ???ѧ??U{3???

Whenever I do this exact same process with LWP::UserAgent, it gives me actual content. As a subclass I would think WWW::Mechanize would do the same thing.

I am using version 1.66 and I am on centos5.5

Details

Imported from Google Code issue 236 via archive

oalders commented 6 years ago

This appears to be a quirk with how compressed data is handled in LWP vs Mech. I don't see how max_size enters into it.