camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryce Ewing <>
Subject Error with RSS component accessing gzip content
Date Sat, 17 Jul 2010 09:42:39 GMT


I have found at least one site that responds to a request for their RSS feed
with gzipped content, without being asked to.  If you request the URL using
curl (with no options) you get binary (gzipped) data back if you use curl
--compressed then curl expects this and displays the content in ascii.

What this means for the Camel RSS component is that in this block of code
        InputStream in = new URL(feedUri).openStream();
        SyndFeedInput input = new SyndFeedInput();
        return XmlReader(in));
The content that comes out of the input stream is gzipped content and when
it is parsed an exception is thrown:
        Invalid XML: Error on line 1: Content is not allowed in prolog.

A simple test in the debugger at this point in the code showed that using a
GZIPInputStream worked, but then that wouldn't work for a non gzipped

Firstly I am wondering if anyone has come across this before, whether there
is a work around, or maybe I am plain doing something wrong?

Secondly if this indeed in something to be fixed I am willing to look into a
solution (thinking that a more robust http client might catch this through
reading the response headers, which do contain: "Content-Encoding: gzip").


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message