Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #23618 [Routing] allow HEAD method to be defined first (DavidBadura)
This PR was merged into the 3.3 branch. Discussion ---------- [Routing] allow HEAD method to be defined first | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Since 3.3 it's no longer possible to set the allowed methods to HEAD followed by GET. If you try this you get an `Notice: Undefined offset: 0` error. ``` index: path: '/' defaults: _controller: AppBundle:Default:index methods: [HEAD, GET] ``` It works perfectly if you change the ordering of the allowed methods: ``` index: path: '/' defaults: _controller: AppBundle:Default:index methods: [GET, HEAD] ``` The problem has been added in this commit: dd647ff#diff-3b72491a9ba1cff58442b845ae837eb3R297 After an `array_filter` the keys will not be reset. So the key `0` does not exist anymore and this check `if ('$methods[0]' !== \$$methodVariable) {` fails. A simple `array_values` fix this issue. Commits ------- 52e2821 Router: allow HEAD method to be defined first
- Loading branch information