Skip to content

Commit 677bba3

Browse files
committed
Add cache headers to JWKS URL
1 parent b654722 commit 677bba3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • apps/backend/src/app/api/latest/projects/[project_id]/.well-known/jwks.json

apps/backend/src/app/api/latest/projects/[project_id]/.well-known/jwks.json/route.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const GET = createSmartRouteHandler({
2727
body: yupObject({
2828
keys: yupArray().defined(),
2929
}).defined(),
30+
3031
}),
3132
async handler({ params, query }) {
3233
const project = await getProject(params.project_id);
@@ -39,6 +40,10 @@ export const GET = createSmartRouteHandler({
3940
statusCode: 200,
4041
bodyType: "json",
4142
body: await getPublicProjectJwkSet(params.project_id, query.include_anonymous === "true"),
43+
headers: {
44+
// Cache for 1 hour
45+
"Cache-Control": "public, max-age=3600",
46+
},
4247
};
4348
},
4449
});

0 commit comments

Comments
 (0)