Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Router concat host on url generation with absolute_path setted if router.request_context.host setted too #21971

Copy link
Copy link
Closed
@cirovargas

Description

@cirovargas
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.1.9

Facts:

I configured in my parameter.yml the router variables: host and scheme

router.request_context.host: mydomain11.com
router.request_context.scheme: http

I want to generate a route link to email from another host so I do this:

$mylink = 'http: //mydomain22.com'.$this-> generateUrl (' my_route ',array(), UrlGeneratorInterface :: ABSOLUTE_PATH)

I know the right thing is set the host in context (but it is not the case here)

The bug is that even i need an absolute path, if the current host is different from the configured in the parameters the router concat the host:

Symfony\Component\Routing\Generator\UrlGenerator

if ($routeHost !== $host) {
                    $host = $routeHost;
                    if (self::ABSOLUTE_URL !== $referenceType) {
                        $referenceType = self::NETWORK_PATH;
                    }
                }

Whenever i want to generate an absolute path the router should ignore any host parameter

That's right? If no i can do a pull request

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.