PoCo::Client::HTTP content decoding issue, and proposed deprecation

Rocco Caputo <[email protected]>
Newsgroups gmane.comp.lang.perl.poe
Message-ID <[email protected]>
POE::Component::Client::HTTP quietly decodes HTTP::Response content  
before passing the object back to application code.  It does so for  
the convenience of application programmers who just want to deal with  
HTML.

This is not always the right thing to do.  For example, downloaded .gz  
files will be saved to disk uncompressed because the content is  
silently uncompressed.

Gisle Aas explains why transparent decoding in library space can be  
bad: http://www.mail-archive.com/[email protected]/msg04703.html (among  
other places).

So I'm thinking about removing it, and forcing the application  
programmer to use decoded_content() explicitly if they need it.

This would break programs that rely on the transparent decoding, so  
I'm considering doing it in stages:

1a. Only decode content for text/* that is gzip encoded.  All other  
content would be passed through unchanged.

1b. Add a new option to do transparent decoding, and leave it on by  
default.

2. Later, throw a warning if the option is turned on.  Remind the  
application developer to use decoded_content() if they want decoded  
content.

3. Later, throw a hard error (and reminder) at the developer if the  
option is enabled.

4. Later, remove the transparent decoding feature and option altogether.

-- 
Rocco Caputo - [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.