Posted to tcl by patthoyts at Sun Nov 22 22:31:23 GMT 2009view raw

  1. The 'if-modified-since header is optiona. It turns out the Android browser didn't send it and
  2. the current Wub cache code errors without it.
  3.  
  4.  
  5. Index: Wub/Cache.tcl
  6. ===================================================================
  7. --- Wub/Cache.tcl (revision 2083)
  8. +++ Wub/Cache.tcl (working copy)
  9. @@ -23,6 +23,9 @@
  10. if {![dict exists $cached -file]} {
  11. return 0 ;# not a file at all
  12. }
  13. + if {![dict exists $req if-modified-since]} {
  14. + return 0 ;# No mtime provided
  15. + }
  16. set since [Http DateInSeconds [dict get $req if-modified-since]]
  17. set mtime [file mtime [dict get $cached -file]]
  18. if {$since ne $mtime} {