Closed (fixed)
Project:
Feeds
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2011 at 17:49 UTC
Updated:
31 Jul 2012 at 22:21 UTC
Jump to comment: Most recent file
drupal_http_request() returns headers with the keys all lowercased. Feeds doesn't realize this, so the etag, and last-modified headers are never found.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | feeds-drupal_http_request-1372074-10.patch | 7.09 KB | emackn |
| #8 | feeds-drupal_http_request-1372074-8.patch | 5.49 KB | emackn |
| #5 | feeds-drupal_http_request-1372074-5.patch | 2.31 KB | twistor |
| #4 | feeds-drupal_http_request-1372074-4.patch | 2.02 KB | twistor |
| #2 | feeds-drupal_http_request-1372074-2-6x.patch | 1.42 KB | twistor |
Comments
Comment #1
twistor commentedHere's the patch. I removed the weird header-setting thing at the end since the headers are checked with empty() which is fine for unset values.
Needs 6.x as well.
Comment #2
twistor commented6.x version.
Comment #3
emackn commenteddrupal_http_request is normalizing all the headers to lower case. Feeds should expect this. So the fix is to update what headers are getting checked earlier on in http_request_get and updating all the header keys to be correctly normalized to match what drupal_http_request returns.
Comment #4
twistor commentedThe other part to this is that curl doesn't normalize the headers.
Comment #5
twistor commentedThis gets rid of the $has_etag which is never used for anything.
Comment #6
emackn commentedis $has_etag being used anywhere? I'm also trying to build a test for this.
Comment #7
twistor commentedI did a find all in http_request.inc and the only two places it's used are the two assignments that I removed. I'm guessing that it was going to be used to conditionally add the header array to the request, but latter discovered that it's unnecessary.
Comment #8
emackn commentedhow does this work? I added an update for Content-Type on line 59 and converted the headers to lower case before they go into cache around 186.
Comment #9
twistor commentedGood catch on the content-type. Are there any other places that access headers? I did some searching and didn't find anything.
A couple of pedantic remarks:
Seems to be working well.
Comment #10
emackn commentedre-rolled with suggestions.
Comment #11
twistor commentedbang
Comment #12
emackn commentedcommitted
Comment #13
twistor commentedComment #14
twistor commentedComment #15
twistor commented6.x http://drupalcode.org/project/feeds.git/commit/73a38b5