Skip to content

Commit

Permalink
also serve png/ico/svg files raw, if they exist
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Oct 2, 2024
1 parent 98d0c92 commit f796471
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
$ha = substr($hash, 0, 2);
header("Content-Type: image/jpeg");
print(file_get_contents("data/$silo/$ha/$hash"));
} elseif (preg_match('/.*\.(jpg|jpeg|gif|js|css)/', $_SERVER["REQUEST_URI"])) {
} elseif (
preg_match('/.*\.(jpg|jpeg|gif|png|ico|svg|js|css)/', $_SERVER["REQUEST_URI"])
&& file_exists($_SERVER["DOCUMENT_ROOT"] . $_SERVER["REQUEST_URI"])
) {
return false;
} else {
require_once("index.php");
Expand Down

0 comments on commit f796471

Please sign in to comment.