Skip to content

UrlMatcher BC break #31066

@umpirsky

Description

@umpirsky

Symfony version(s) affected: 4.1.11

Description
With version 4.1.2, urls with trailing slash were not matched, in 4.1.11 they are. I guess it's related to https://symfony.com/doc/4.1/routing.html#routing-trailing-slash-redirection, but it's a BC break.

How to reproduce

I created demo project https://github.com/umpirsky/SUMT which makes it easy to prove this two versions are not behaving the same way while using Symfony public API which should be stable across minor upgrades:

git clone git@github.com:umpirsky/SUMT.git
composer install
git checkout master
./vendor/bin/phpunit src/Umpirsky/SUMT/UrlMatcherTest.php
PHPUnit 8.1.2 by Sebastian Bergmann and contributors.

..                                                                  2 / 2 (100%)

Time: 28 ms, Memory: 4.00 MB

OK (2 tests, 2 assertions)

git checkout 4.1.11
composer install

./vendor/bin/phpunit src/Umpirsky/SUMT/UrlMatcherTest.php
PHPUnit 8.1.2 by Sebastian Bergmann and contributors.

.F                                                                  2 / 2 (100%)

Time: 33 ms, Memory: 4.00 MB

There was 1 failure:

1) Umpirsky\SUMT\UrlMatcherTest::testDontMatch
Failed asserting that exception of type "Symfony\Component\Routing\Exception\ResourceNotFoundException" is thrown.

FAILURES!
Tests: 2, Assertions: 2, Failures: 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy