diff options
Diffstat (limited to 'test/data/if_modified_since.php')
-rw-r--r-- | test/data/if_modified_since.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/data/if_modified_since.php b/test/data/if_modified_since.php new file mode 100644 index 000000000..098b7da85 --- /dev/null +++ b/test/data/if_modified_since.php @@ -0,0 +1,20 @@ +<?php +error_reporting(0); + +$ts = $_REQUEST['ts']; + +$ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false; +if ($ifModifiedSince == $ts) { + header('HTTP/1.0 304 Not Modified'); + die; // stop processing +} + +header("Last-Modified: " . $ts); + +if ( $ifModifiedSince ) { + echo "OK: " . $ts; +} else { + echo "FAIL"; +} + +?> |