]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix problem odd headers sent by Windows CE
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 1 Oct 2008 08:13:56 +0000 (03:13 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 1 Oct 2008 08:13:56 +0000 (03:13 -0500)
basis/http/server/static/static.factor

index 5ae18156b084582eae7339466d03f0ce886ba776..3e3307033ad085cc3f61911608e95dd191399ea3 100755 (executable)
@@ -3,7 +3,7 @@
 USING: calendar io io.files kernel math math.order\r
 math.parser namespaces parser sequences strings\r
 assocs hashtables debugger mime-types sorting logging\r
-calendar.format accessors\r
+calendar.format accessors splitting\r
 io.encodings.binary fry xml.entities destructors urls\r
 html.elements html.templates.fhtml\r
 http\r
@@ -14,9 +14,13 @@ IN: http.server.static
 \r
 TUPLE: file-responder root hook special allow-listings ;\r
 \r
+: modified-since ( request -- date )\r
+    "if-modified-since" header ";" split1 drop\r
+    dup [ rfc822>timestamp ] when ;\r
+\r
 : modified-since? ( filename -- ? )\r
-    request get "if-modified-since" header dup [\r
-        [ file-info modified>> ] [ rfc822>timestamp ] bi* after?\r
+    request get modified-since dup [\r
+        [ file-info modified>> ] dip after?\r
     ] [\r
         2drop t\r
     ] if ;\r