aaronlord / laroute

Generate Laravel route URLs from JavaScript.
MIT License
796 stars 138 forks source link

Fix routes with null hosts using `null` as the host in the generated URL #50

Closed rtheunissen closed 7 years ago

rtheunissen commented 7 years ago

I don't know if this solution is correct, because if absolute is false, we should never return the // other host URL. Right now we're not checking for that at all.

In our project, all our routes have null as the host, but absolute is false, so it doesn't matter. Even though we want relative routes, we're getting https://null/etc/etc.

An alternative solution here is to move the isOtherHost check into getCorrectUrl and only check if we are concerned with the host at all, ie. when absolute is true.

antonigiske commented 7 years ago

Had the same problem, and this fixed it.