1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-24 16:53:17 +00:00

Set Last-Modified header for atom feeds, fixes #2988

This commit is contained in:
Daniel Supernault 2022-08-15 22:29:07 -06:00
parent c3e8a0e439
commit c18dcde38f
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -118,8 +118,7 @@ class ProfileController extends Controller
'list' => $settings->show_profile_followers
]
];
$ui = $request->has('ui') && $request->input('ui') == 'memory' ? 'profile.memory' : 'profile.show';
return view($ui, compact('profile', 'settings'));
return view('profile.show', compact('profile', 'settings'));
}
}
@ -210,7 +209,7 @@ class ProfileController extends Controller
->whereProfileId($pid)
->whereVisibility('public')
->whereType('photo')
->latest()
->orderByDesc('id')
->take(10)
->get()
->map(function($status) {
@ -224,10 +223,14 @@ class ProfileController extends Controller
})
->values();
$permalink = config('app.url') . "/users/{$profile['username']}.atom";
$headers = ['Content-Type' => 'application/atom+xml'];
if($items && $items->count()) {
$headers['Last-Modified'] = now()->parse($items->first()['created_at'])->toRfc7231String();
}
return response()
->view('atom.user', compact('profile', 'items', 'permalink'))
->header('Content-Type', 'application/atom+xml');
->withHeaders($headers);
}
public function meRedirect()