16 lines
374 B
TypeScript
16 lines
374 B
TypeScript
|
import type { APIRoute } from "astro"
|
||
|
|
||
|
function getSecurityTxt(site?: URL) {
|
||
|
const canonical = new URL("/.well-known/security.txt", site)
|
||
|
return `
|
||
|
Contact: mailto:security@martials.no
|
||
|
Expires: 2029-12-31T23:00:00.000Z
|
||
|
Preferred-Languages: no,en
|
||
|
Canonical: ${canonical.href}
|
||
|
`
|
||
|
}
|
||
|
|
||
|
export const GET: APIRoute = ({ site }) => {
|
||
|
return new Response(getSecurityTxt(site))
|
||
|
}
|