FOSJsRoutingBundle icon indicating copy to clipboard operation
FOSJsRoutingBundle copied to clipboard

Non standard http port on route with "host" parameter defined

Open chandon opened this issue 10 years ago • 5 comments

When generating a route defined with the host parameter :

test_route:
    host: www.test.com
    path: /MyTest
    defaults: { _controller: TestBundle:Test:Test  }

the function Routing.generate('test_route') always generate an absolute URL using the host defined in the "host:" parameter of the route. But if the http port is not the standard port, it seems there is no way for Routing.generate to add this port to the absolute generated Url.

I tried with the parameters :

framework:
    router:
        http_port: 81

parameters:
    router.request_context.host: 81

The URL generated shoud be http://www.test.com:81/MyTest but the one generated is http://www.test.com/MyTest

chandon avatar Nov 19 '14 11:11 chandon

I was not using the master version, the issue is now solved

chandon avatar Dec 11 '14 14:12 chandon

No in fact, it wasn't fully solved !

chandon avatar Dec 11 '14 16:12 chandon

@chandon so what is the status of this?

willdurand avatar Feb 05 '16 09:02 willdurand

This is still an open issue on the latest stable (1.6.0 as of today) and looking at the code on master it doesn't seem to have been fixed.

DerekRoth avatar Dec 14 '16 18:12 DerekRoth

I think we'll have to wait 2 more years before #185 been merged :)

chandon avatar Dec 15 '16 11:12 chandon