Loading core/lib/Drupal/Core/Entity/Controller/EntityViewController.php +0 −2 Original line number Diff line number Diff line Loading @@ -147,7 +147,6 @@ public function view(EntityInterface $_entity, $view_mode = 'full') { 'rel' => 'canonical', 'href' => $url->toString(), ], TRUE, ]; // Set the non-aliased canonical path as a default shortlink. Loading @@ -156,7 +155,6 @@ public function view(EntityInterface $_entity, $view_mode = 'full') { 'rel' => 'shortlink', 'href' => $url->setOption('alias', TRUE)->toString(), ], TRUE, ]; // Since this generates absolute URLs, it can only be cached "per site". Loading core/modules/node/tests/src/Functional/NodeViewTest.php +1 −11 Original line number Diff line number Diff line Loading @@ -2,8 +2,6 @@ namespace Drupal\Tests\node\Functional; use Drupal\Component\Utility\Html; /** * Tests the node/{node} page. * Loading Loading @@ -37,16 +35,8 @@ public function testHtmlHeadLinks() { */ public function testLinkHeader() { $node = $this->drupalCreateNode(); $expected = [ '<' . Html::escape($node->toUrl('canonical')->setAbsolute()->toString()) . '>; rel="canonical"', '<' . Html::escape($node->toUrl('canonical', ['alias' => TRUE])->setAbsolute()->toString()) . '>; rel="shortlink"', ]; $this->drupalGet($node->toUrl()); $links = $this->getSession()->getResponseHeaders()['Link']; $this->assertEquals($expected, $links); $this->assertArrayNotHasKey('Link', $this->getSession()->getResponseHeaders()); } /** Loading Loading
core/lib/Drupal/Core/Entity/Controller/EntityViewController.php +0 −2 Original line number Diff line number Diff line Loading @@ -147,7 +147,6 @@ public function view(EntityInterface $_entity, $view_mode = 'full') { 'rel' => 'canonical', 'href' => $url->toString(), ], TRUE, ]; // Set the non-aliased canonical path as a default shortlink. Loading @@ -156,7 +155,6 @@ public function view(EntityInterface $_entity, $view_mode = 'full') { 'rel' => 'shortlink', 'href' => $url->setOption('alias', TRUE)->toString(), ], TRUE, ]; // Since this generates absolute URLs, it can only be cached "per site". Loading
core/modules/node/tests/src/Functional/NodeViewTest.php +1 −11 Original line number Diff line number Diff line Loading @@ -2,8 +2,6 @@ namespace Drupal\Tests\node\Functional; use Drupal\Component\Utility\Html; /** * Tests the node/{node} page. * Loading Loading @@ -37,16 +35,8 @@ public function testHtmlHeadLinks() { */ public function testLinkHeader() { $node = $this->drupalCreateNode(); $expected = [ '<' . Html::escape($node->toUrl('canonical')->setAbsolute()->toString()) . '>; rel="canonical"', '<' . Html::escape($node->toUrl('canonical', ['alias' => TRUE])->setAbsolute()->toString()) . '>; rel="shortlink"', ]; $this->drupalGet($node->toUrl()); $links = $this->getSession()->getResponseHeaders()['Link']; $this->assertEquals($expected, $links); $this->assertArrayNotHasKey('Link', $this->getSession()->getResponseHeaders()); } /** Loading