[wp-testers] Bug 1275 - RSS Gives 304's

Dougal Campbell dougal at gunters.org
Mon Apr 25 20:24:39 GMT 2005


Michael D Adams wrote:
> I added a note to mosquito 
> http://mosquito.wordpress.org/view.php?id=1275 but thought I'd ask 
> people to look it over here.
> 
> Changing the || to an && on line 137 of the latest SVN produces the 
> correct 200 v. 304 behavior, as far as I can tell. I'm not sure that the 
> logic is perfect, though; I'm unfamiliar with HTTP_IF_NONE_MATCH and 
> therefore don't know what the ${X}_etag variables are.
> 
> The (edited) line in question is
> if ( (strtotime($client_last_modified) <= strtotime($wp_last_modified)) 
> && ($client_etag == $wp_etag) ) {
> 
> Hopefully someone can tell me what HTTP_IF_NONE_MATCH is and why what 
> I've done is wrong :)
> Michael

  For one thing, there's nothing to handle the case where there's an 
Hrm... The logic that's in the current version is incorrect. I think 
somebody tried to simplify the logic, but wound up munging things a bit. 
For one thing, there's no logic to handle the case where there's an 
If-None-Match (client ETag) or an If-Modified-Since, but not both.

And the logic that remains is incorrect. If the If-None-Match and 
If-Modified-Since headers are both present, then *both* conditions must 
be valid (i.e. it should use an AND condition, not an OR, as your patch 
does).

I know that the old logic looked redundant, but from what I can see, it 
*was* correct. It checked to see if both headers were present. If so, it 
made sure that _both_ matched. If not, it made sure that the one that 
existed matched.


-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/



More information about the wp-testers mailing list