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
| Comment | File | Size | Author |
|---|---|---|---|
| common.inc_.6.9.patch | 377 bytes | reaneyk |
Comments
Comment #1
reaneyk commentedchanging status
Comment #2
damien tournoud commentedI'm tempted to mark this as "won't fix": drupal_http_request() doesn't send a
Accept-Encoding: gzip,deflateheader, and, as a result, a server shouldn't return gzip-encoded data. The bug is probably in the coldfusion script.Comment #3
reaneyk commentedyep, turned out to be a server config issue not including the deflate in the Accept-Encoding.
Thanks Damien Tournoud
Comment #4
torotil commentedI 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:
— 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: identityor by handling theContent-Encodingheader as is shown here: https://drupal.stackexchange.com/a/136774