-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from aleevas/DS-1471
feat: [DS-1471] Update redirect to avoid redirecting for cached scripts and styles
- Loading branch information
Showing
3 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
openy_system/src/EventSubscriber/Routing/RouteSubscriber.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Drupal\openy_system\Routing; | ||
|
||
use Drupal\Core\Routing\RouteSubscriberBase; | ||
use Symfony\Component\Routing\RouteCollection; | ||
|
||
/** | ||
* Modify core routes to support redirect. | ||
*/ | ||
class RouteSubscriber extends RouteSubscriberBase { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function alterRoutes(RouteCollection $collection) { | ||
// See https://www.drupal.org/project/redirect/issues/3373123 . | ||
if ($route = $collection->get('system.js_asset')) { | ||
$route->setDefault('_disable_route_normalizer', TRUE); | ||
} | ||
if ($route = $collection->get('system.css_asset')) { | ||
$route->setDefault('_disable_route_normalizer', TRUE); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters