redirectToRoute('tvdt_backoffice_settings'); } /** * @see https://www.rfc-editor.org/rfc/rfc9116 * * @throws DatetimeException * @throws \Exception */ #[Route('/.well-known/security.txt', name: 'tvdt_well_known_security_txt', methods: ['GET'])] public function securityTxt(): Response { // One year after the container build, so the file goes stale when deployments stop. // In prod the build arg must be set; falling back to 'now' would renew Expires on every request, // defeating the go-stale purpose. In dev/test 'now' is fine — no build bake happens there. if ((null === $this->buildTime || '' === $this->buildTime) && 'prod' === $this->appEnv) { throw new \LogicException('BUILD_TIME env var must be set in production (baked in during Docker build).'); } $buildTime = (null !== $this->buildTime && '' !== $this->buildTime) ? $this->buildTime : 'now'; $expires = new DateTimeImmutable($buildTime)->modify('+1 year')->format(\DATE_RFC3339); $content = << 'text/plain; charset=UTF-8']); } }