Skip to content

Commit 8f72337

Browse files
committed
Move TTL into a const value
1 parent eb614ff commit 8f72337

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/controllers/Attachment/Download.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
class Download extends Controller {
1818

19+
const TTL_ONE_YEAR = 31536000;
20+
1921
public function run(Router &$router) {
2022
switch ($router->getRequestPathExtension()) {
2123
case "":
@@ -40,7 +42,7 @@ public function run(Router &$router) {
4042
ob_start();
4143
$view->render($model);
4244
$router->setResponseCode(($model->attachment ? 200 : 404));
43-
$router->setResponseTTL(31536000); // 1 year
45+
$router->setResponseTTL(self::TTL_ONE_YEAR);
4446
$router->setResponseHeader("Content-Type", $view->getMimeType());
4547
if ($model->extra_headers) {
4648
foreach ($model->extra_headers as $name => $value) {

0 commit comments

Comments
 (0)