Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: reaneyk commentedchanging status
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedI'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.Comment #3
reaneyk CreditAttribution: reaneyk commentedyep, turned out to be a server config issue not including the deflate in the Accept-Encoding.
Thanks Damien Tournoud
Comment #4
torotil CreditAttribution: torotil at more onion 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: identity
or by handling theContent-Encoding
header as is shown here: https://drupal.stackexchange.com/a/136774