From ff47aa86dd27eed358eeda104ee1d85c08229577 Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Tue, 26 Sep 2023 08:06:17 +0300 Subject: [PATCH] UHF-8702: Switched the code to 410 on unpublished job listings. --- .../src/EventSubscriber/JobListingRedirectSubscriber.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php index 716cd709..618668dc 100644 --- a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php +++ b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php @@ -69,8 +69,9 @@ public function on403(ExceptionEvent $event): void { $url = Url::fromRoute('entity.node.canonical', ['node' => $redirectNode])->toString(); - // Set temporary redirect. - $response = new TrustedRedirectResponse($url, 307); + // Set status code to 410. + $response = new TrustedRedirectResponse($url); + $response->setStatusCode(410); $event->setResponse($response); }