diff --git a/src/Controller/ModListPublicController.php b/src/Controller/ModListPublicController.php index 6aff9be3..976421a5 100644 --- a/src/Controller/ModListPublicController.php +++ b/src/Controller/ModListPublicController.php @@ -67,7 +67,7 @@ public function customizeAction(ModList $modList): Response */ public function downloadAction(ModList $modList, string $optionalModsJson = null): Response { - $name = sprintf('AF %s %s.html', $modList->getName(), (new \DateTimeImmutable())->format('Y-m-d H-i-s')); + $name = sprintf('ArmaForces %s %s', $modList->getName(), (new \DateTimeImmutable())->format('Y_m_d H_i')); $mods = $this->modRepository->findIncludedSteamWorkshopMods($modList); $optionalMods = json_decode($optionalModsJson ?? '', true) ?: []; @@ -79,7 +79,10 @@ public function downloadAction(ModList $modList, string $optionalModsJson = null ]); return new Response($template, Response::HTTP_OK, [ - 'Content-Disposition' => HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $name), + 'Content-Disposition' => HeaderUtils::makeDisposition( + HeaderUtils::DISPOSITION_ATTACHMENT, + $name.'.html' + ), ]); } } diff --git a/src/Test/Traits/AssertsTrait.php b/src/Test/Traits/AssertsTrait.php index f0ba9597..7fb640a7 100644 --- a/src/Test/Traits/AssertsTrait.php +++ b/src/Test/Traits/AssertsTrait.php @@ -22,7 +22,7 @@ public static function assertTeamSpeakUrlVisible(Crawler $crawler, bool $visible public static function assertResponseContainsModListAttachmentHeader(Response $response, ModList $modList): void { $contentDispositionHeader = $response->headers->get('Content-Disposition'); - $pattern = "/^attachment; filename=\"AF {$modList->getName()} \\d{4}-\\d{2}-\\d{2} \\d{2}-\\d{2}-\\d{2}.html\"$/"; + $pattern = "/^attachment; filename=\"ArmaForces {$modList->getName()} \\d{4}_\\d{2}_\\d{2} \\d{2}_\\d{2}.html\"$/"; self::assertTrue(1 === preg_match($pattern, $contentDispositionHeader)); }