From 392d6ad917f32142d3efd2c7c0e54fad1a322774 Mon Sep 17 00:00:00 2001
From: Timm Friebe <thekid@thekid.de>
Date: Fri, 12 Feb 2016 21:23:19 +0100
Subject: [PATCH] Fix problem delivering files with an incorrect content length

---
 ChangeLog.md                                    | 6 ++++++
 src/main/php/xp/scriptlet/FileHandler.class.php | 1 +
 2 files changed, 7 insertions(+)

diff --git a/ChangeLog.md b/ChangeLog.md
index c1da520b..abfb75c2 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -3,6 +3,12 @@ Scriptlets for the XP Framework ChangeLog
 
 ## ?.?.? / ????-??-??
 
+## 7.0.1 / 2016-02-12
+
+* Fixed problem delivering files with an incorrect content length when
+  file size has changed between requests
+  (@thekid)
+
 ## 7.0.0 / 2016-02-01
 
 * Adjusted location of web/config help, see xp-runners/reference#32
diff --git a/src/main/php/xp/scriptlet/FileHandler.class.php b/src/main/php/xp/scriptlet/FileHandler.class.php
index 82220238..aa681e63 100755
--- a/src/main/php/xp/scriptlet/FileHandler.class.php
+++ b/src/main/php/xp/scriptlet/FileHandler.class.php
@@ -74,6 +74,7 @@ public function handleRequest($method, $query, array $headers, $data, Socket $so
       }
     }
 
+    clearstatcache();
     try {
       $f->open(File::READ);
     } catch (IOException $e) {