AI tracker: owner-only tabs no longer 500 (cache-control set twice: layout + page load)
Deploy production / deploy (push) Successful in 1m14s
Deploy production / deploy (push) Successful in 1m14s
This commit is contained in:
1 parent
22279d181f
commit
7396d23335
3 files changed
+6
-3
No files matched your search
@@ -6,8 +6,9 @@ import type { Actions, PageServerLoad } from './$types';
|
||||
// Owner only: dated usage numbers per provider. Actions don't run the load, so each
|
||||
// action checks the owner again (hooks.server.ts also 404s this path for everyone else).
|
||||
export const load: PageServerLoad = async (event) => {
|
||||
// cache-control comes from the ai layout (owner) and hooks.server.ts; setting it here too threw
|
||||
// header_already_set (500) for the owner.
|
||||
requireOwner(event);
|
||||
event.setHeaders({ 'cache-control': 'private, no-store' });
|
||||
return {
|
||||
entries: await loadUsage(),
|
||||
seo: { title: 'AI tracker · usage', description: 'My AI usage.', index: false }
|
||||
|
||||
Reference in new issue
Block a user