I recently ran into the issue of trying to use the aggregator module to read a feed from a page from a server using gzip compression. From my debugging I realized that the drupal_http_request function does not reinflate gzip content and caused errors when I tried to read the RSS feed. I attached a small patch that checks for gzipped data and will reinflate it into a format usable by Drupal.

Drupal running on:
5.2.4-2ubuntu5.4
Drupal 6.9

Reading RSS Feed from:
Microsoft-IIS/6.0
ColdFusion script that generated RSS feed
content type returned: [Content-Encoding] => gzip

CommentFileSizeAuthor
common.inc_.6.9.patch377 bytesreaneyk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

reaneyk’s picture

Status: Active » Needs review

changing status

Damien Tournoud’s picture

I'm tempted to mark this as "won't fix": drupal_http_request() doesn't send a Accept-Encoding: gzip,deflate header, and, as a result, a server shouldn't return gzip-encoded data. The bug is probably in the coldfusion script.

reaneyk’s picture

Status: Needs review » Closed (fixed)

yep, turned out to be a server config issue not including the deflate in the Accept-Encoding.

Thanks Damien Tournoud

torotil’s picture

Version: 6.9 » 7.x-dev
Issue summary: View changes

I don’t think this will lead to a change in Drupal 7 at this point, but actually the reason cited here is wrong. The HTTP specs say:

If no Accept-Encoding header field is in the request, any content coding is considered acceptable by the user agent.

https://www.rfc-editor.org/rfc/rfc9110.html#section-12.5.3-10.1

Users can work around this by either explicitly specifying Accept-Encoding: identity or by handling the Content-Encoding header as is shown here: https://drupal.stackexchange.com/a/136774