Skip to content

Commit 6fcbc11

Browse files
committed
Simplify code for generating Atom feed
1 parent ffc1496 commit 6fcbc11

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"xp-framework/networking": "^10.4",
1111
"xp-forge/web": "^4.0",
1212
"xp-forge/web-auth": "^5.0",
13-
"xp-forge/frontend": "^6.0",
13+
"xp-forge/frontend": "^6.4",
1414
"xp-forge/rest-api": "^4.0",
1515
"xp-forge/rest-client": "^5.3",
1616
"xp-forge/handlebars-templates": "^3.0",

src/main/php/de/thekid/dialog/web/Feed.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use de\thekid\dialog\{Repository, Pagination};
44
use util\Date;
5-
use web\Headers;
65
use web\frontend\{Handler, Header, Get, Param, View};
76

87
#[Handler('/feed')]
@@ -26,9 +25,9 @@ public function atom(#[Header('If-Modified-Since')] $since= null) {
2625
}
2726

2827
return $view
29-
->header('Cache-Control', 'public, max-age=3600')
30-
->header('Content-Type', 'application/atom+xml; charset=utf-8')
31-
->header('Last-Modified', Headers::date($items[0]['date'] ?? null))
28+
->modified($items[0]['date'] ?? null)
29+
->cache('public, max-age=3600')
30+
->type('application/atom+xml; charset=utf-8')
3231
;
3332
}
3433
}

0 commit comments

Comments
 (0)