Yii2: Debug bar with normalizer, infinite redirect

Created on 17 Sep 2018  路  4Comments  路  Source: yiisoft/yii2

What steps will reproduce the problem?

Enable URL normalizer and set suffix="/"

        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'suffix' => '/',
            'normalizer' => [
                'class' => 'yii\web\UrlNormalizer',
                // use temporary redirection instead of permanent for debugging
                'action' => YII_DEBUG?\yii\web\UrlNormalizer::ACTION_REDIRECT_TEMPORARY:\yii\web\UrlNormalizer::ACTION_REDIRECT_PERMANENT,
            ],
..

What is the expected result?

Load Yii2 debug bar

What do you get instead?

Infinite redirect.

  • 302; /debug/default/toolbar?tag=5b9f85c2980d9
  • 302; /debug/default/toolbar/?tag=5b9f85c2980d9
  • 302; /debug/default/toolbar?tag=5b9f85c2980d9
    etc.

Additional info

Fixed it by adding: "'normalizer' => false" in yii2-debug/src/Module from line: 202 on both rules.

| Q | A
| ---------------- | ---
| Yii version | 2.0.15.1
| PHP version | 7.2.9
| Operating system |

to be verified bug

All 4 comments

This should be fixed in normalizer too.

Yii 2.0.17-dev works fine with exactly the same urlManager config.

Thanks for checking.

Was this page helpful?
0 / 5 - 0 ratings