OCDProgrammer.com

It's Microsoft's World, and I'm just living in it
View Clarence Klopfstein's profile on LinkedIn

Clarence Klopfstein's Facebook profile

This site is under construction...

Categories

New Comments

Referring Sites


Disclaimer

  • This is MY blog. The views represented here are not in relation to anybody else. Please read my full disclaimer for a more complete disclaimer.

Testing If-Modified-Since header on Windows

December 14, 2007 21:52 by ckincincy

As my previous post alluded to, my blog has had an issue with FeedBurner.  Basically their site is not updating my feed when my scheduled post become visible. 

Matt Shobe (yep, co-founder of FeedBurner) told me that my If-Modified-Since header was inaccurate, and a potential cause of the issue.  So I went on searching for a way to test this header on my Windows XP box.  Couldn't find one, so I emailed Matt and asked him if he could point me in the right direction.

He said you could use Linux (don't have a version installed) or I could possibly use Cygwin.  And I can!  So I grabbed the latest version and looked through all the packages and found two that had curl in them (in the Net component).  Let Cygwin install then ran this line in the command line that appears when you launch Cygwin:
curl -H 'If-Modified-Since: Wed, 12 Dec 2007 05:59:00 -800' -IL http://www.ocdprogrammer.com/myfeed.axd (don't go to it, it isn't valid)

And sure enough my BlogEngine had a bug in it.  I've since fixed the bug and hope it resolves the issue.  We will find out in the morning as my LifeBlog has a post scheduled for six in the morning.

I am blown away that FeedBurner is as helpful as it is when it comes to support.  Thanks Matt!  Because regardless of whether or not this bug is the cause of my FeedBurner issue, it was a bug and now the BE platform is better since it is fixed.


Comments

December 15. 2007 00:27

It's really cool that you were able to track that down.  Could you tell me if the bug fix you mentioned is something that can be done to the currently released version 1.2.0.0?  I also noticed there are a couple of issues when I used the feedburner feed validity at http://feedvalidator.org...

Chris Blankenship |

December 15. 2007 02:44

Nice find! Do you plan to submit this to the CodePlex site for inclusion in the next release?

Chris Luebbe |

December 15. 2007 02:50

This is what you get when you post comments on blogs this early in the morning.

Clarence, feel free to delete both these comments Smile

Chris Luebbe |

December 15. 2007 04:14

I did link to my bug submission on the BE Codeplex forum.  But for easy reference, here is my fix.

In the SyndicationHandler.cs file on line 217 there is this line:
lastModified = items[0].DateModified;

Now the problem here is that if you have a post scheduled (ie your wrote it well in advance of its publish date) this will set the last Modified date to some date in the past. So what I did was change this line to return the greater of two values:
lastModified = (items[0].DateModified > items[0].DateCreated ? items[0].DateModified : items[0].DateCreated);

The DateCreated is the PubDate of the post. This fixed my If-Modified-Since test to return the expected result... and should be included in the code.

ckincincy |

December 15. 2007 04:15

I generally have two validity issues on my feed, one where it expects an email address in it....  not thanks.  Don't want the spam.  The other when I insert object tags.  I think both of those are non-issues.

ckincincy |

December 19. 2007 03:40

FYI, it looks like Mads has fixed this. It shows fixed on the Codeplex site. Nice job!

Chris Luebbe |

August 3. 2008 04:47

I have curl/cygwin setup as well, and I tell you, You could have probably found that out a lot easier by using a Proxy Fuzzer like RatProxy or WebScarab.

Alexander Higgins |

Comments are closed