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

The 'if-modified-since header is optiona. It turns out the Android browser didn't send it and
the current Wub cache code errors without it.


Index: Wub/Cache.tcl
===================================================================
--- Wub/Cache.tcl       (revision 2083)
+++ Wub/Cache.tcl       (working copy)
@@ -23,6 +23,9 @@
        if {![dict exists $cached -file]} {
            return 0    ;# not a file at all
        }
+        if {![dict exists $req if-modified-since]} {
+            return 0   ;# No mtime provided
+        }
        set since [Http DateInSeconds [dict get $req if-modified-since]]
        set mtime [file mtime [dict get $cached -file]]
        if {$since ne $mtime} {