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

Incorrect generation of URLs when no explicit host is passed #373

Closed
danrot opened this issue Jan 13, 2020 · 5 comments
Closed

Incorrect generation of URLs when no explicit host is passed #373

danrot opened this issue Jan 13, 2020 · 5 comments

Comments

@danrot
Copy link

danrot commented Jan 13, 2020

We are using your bundle, and Version 2.5.2 breaks our application, because the URL is generated with the current host, but without the scheme. This results in a relative URL without a starting slash (e.g. example.org/test), and then the gets appended to the current URL, resulting in something like example.org/test/example.org/test, which is not a valid URL in our case.

We have already broken it down to the usage of window.location.host to set the base_url, and then generating the URL without the the scheme.

@tobias-93
Copy link
Collaborator

Hi @danrot,
I'm sorry for the inconvenience, I would think it would be solved if not the base_url would be set to window.location.host as fallback but the host should be set to window.location.host. What do you think?
I may have overlooked this when merging #371.
I will revert #371 and release a new version to mitigate the issue for now, and have a closer look later on.
Regards, Tobias

@danrot
Copy link
Author

danrot commented Jan 13, 2020

Thank you for quickly handling this! And I don't know the codebase too well, if I am completely honest... So I don't really know where this default should actually go without breaking something 🙈

@danrot
Copy link
Author

danrot commented Jan 13, 2020

And by the way, there is the wrong commit referenced for 2.5.3 on packagist: https://packagist.org/packages/friendsofsymfony/jsrouting-bundle#v2.5.3

@danrot
Copy link
Author

danrot commented Jan 13, 2020

Oh, and I don't know how that will affect this feature, but you should also consider the port when implementing it again 🙂

@tobias-93
Copy link
Collaborator

And by the way, there is the wrong commit referenced for 2.5.3 on packagist

I tagged the wrong version when I was releasing 2.5.2, it has been corrected now.
Thanks for the heads up.
The fallback will be fixed in a new issue, I'm closing this issue.

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