Skip to content

Commit

Permalink
Fix GoneDocumentSubscriber by passing sourceHost to RedirectRouteMana…
Browse files Browse the repository at this point in the history
…ger (#72)
  • Loading branch information
niklasnatter authored Apr 30, 2021
1 parent b077f40 commit 2345e8b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion GoneSubscriber/GoneDocumentSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ public function createRedirects(RemoveEvent $event): void

foreach ($this->getUrls($document) as $url) {
try {
$this->redirectRouteManager->saveByData(['source' => $url, 'statusCode' => 410, 'enabled' => true, 'target' => '']);
$this->redirectRouteManager->saveByData([
'source' => $url,
'sourceHost' => null,
'statusCode' => 410,
'enabled' => true,
'target' => '',
]);
} catch (RedirectRouteNotUniqueException $exception) {
// do nothing when there already exists a redirect route
}
Expand Down

0 comments on commit 2345e8b

Please sign in to comment.