aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-08-01 20:55:08 +0200
committerMax Kostikov <max@kostikov.co>2019-08-01 20:55:08 +0200
commitc96a1632f52651fd4acf1a9beae1613caa3962a7 (patch)
treeee0f89f6a4df8960b30d8228b9e3062e387990d3 /boot.php
parent95805d2e7c029fb9b7938102b46ec11d2b69ed7b (diff)
downloadvolse-hubzilla-c96a1632f52651fd4acf1a9beae1613caa3962a7.tar.gz
volse-hubzilla-c96a1632f52651fd4acf1a9beae1613caa3962a7.tar.bz2
volse-hubzilla-c96a1632f52651fd4acf1a9beae1613caa3962a7.zip
Minor optimizations on static file serve
Diffstat (limited to 'boot.php')
-rwxr-xr-xboot.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/boot.php b/boot.php
index a3bdb994e..d28405428 100755
--- a/boot.php
+++ b/boot.php
@@ -919,8 +919,7 @@ class App {
$staticfilecwd = getcwd();
$staticfilerealpath = realpath(self::$cmd);
if(strpos($staticfilerealpath,$staticfilecwd) !== 0) {
- header("HTTP/1.1 404 Not Found", true, 404);
- killme();
+ http_status_exit(404,'not found');
}
$staticfileetag = '"'.md5($staticfilerealpath.filemtime(self::$cmd)).'"';
@@ -930,8 +929,7 @@ class App {
// If HTTP_IF_NONE_MATCH is same as the generated ETag => content is the same as browser cache
// So send a 304 Not Modified response header and exit
if($_SERVER['HTTP_IF_NONE_MATCH'] == $staticfileetag) {
- header('HTTP/1.1 304 Not Modified', true, 304);
- killme();
+ http_status_exit(304,'not modified');
}
}
header("Content-type: ".$serve_rawfiles[$filext]);