Skip to content

[Routing] Deprecated _scheme still used #8898

@danez

Description

@danez

According to the Changelog the _scheme requirement is deprecated in favor of the schemes property.
The _schemeand_methodrequirements have been moved to theschemesandmethods settings

Still everywhere in the symfony/routing code the _schema requirement is used and (the more important part) it is assumed that _schema may only be a single scheme.

So when using the function Route->setSchemes(array) function with multiple schemes some code stops working. In our case the RedirectableUrlMatcher calls now the redirect method with scheme http|https.

Is this something that is planned to be worked on? Or am I just missing something?
If this is really a problem I can have a look at this and send PR.

this is the test for our problem:

    public function testNoSchemaRedirectIfOnOfMultipleSchemesMatches()
    {
        $coll = new RouteCollection();
        $coll->add('foo', new Route('/foo', array(), array(), array(),'', array('http', 'https')));

        $matcher = $this->getMockForAbstractClass('Symfony\Component\Routing\Matcher\RedirectableUrlMatcher', array($coll, new RequestContext()));
        $matcher
            ->expects($this->never())
            ->method('redirect')
        ;
        $matcher->match('/foo');
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions