Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with missing port since 2.5.4 #384

Closed
dmaicher opened this issue Apr 16, 2020 · 4 comments
Closed

issue with missing port since 2.5.4 #384

dmaicher opened this issue Apr 16, 2020 · 4 comments

Comments

@dmaicher
Copy link
Contributor

Since #381 in my app the routes are all generated without a port.

Given I'm on page http://my-host.loc:81/.

2.5.3

fos.Router.setData({
    "base_url": "", "routes": {
        "foo": {
            "tokens": [["text", "\/foo\/"]],
            "defaults": [],
            "requirements": [],
            "hosttokens": [["text", "my-host.loc"]],
            "methods": ["GET", "POST"],
            "schemes": []
        },
    }, "prefix": "", "host": "my-host.loc:81", "port": 81, "scheme": "http", "locale": "en"
});
fos.Router.getInstance().generate('foo');

==> "/foo/"

2.5.4:

fos.Router.setData({
    "base_url": "", "routes": {
        "foo": {
            "tokens": [["text", "\/foo\/"]],
            "defaults": [],
            "requirements": [],
            "hosttokens": [["text", "my-host.loc"]],
            "methods": ["GET", "POST"],
            "schemes": []
        },
    }, "prefix": "", "host": "my-host.loc:81", "port": 81, "scheme": "http", "locale": "en"
});
fos.Router.getInstance().generate('foo');

==> "http://my-host.loc/foo/"

So on 2.5.3 the generated url was relative (and so was taking the correct port of the current url). Now in 2.5.4 the generated url is absolute without a port which breaks my app.

@dmaicher
Copy link
Contributor Author

ping @dew326 maybe you have an idea how to fix this?

@dew326
Copy link
Contributor

dew326 commented May 19, 2020

I will take a look.

@dew326
Copy link
Contributor

dew326 commented May 19, 2020

Hi @dmaicher, I created the PR (#391) could you check if this branch fixes your issue?

@dmaicher
Copy link
Contributor Author

Fixed in #391

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants