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
HistoryLocation doesn't use baseURL correctly #5334
Comments
Ah, I think I see the confusion. But it's perfectly sensible for a page to use And if you ask for For example, on this page: $('<base>').attr('href', '/agent/').prop('href'); // "https://github.com/agent/" |
formatURL: function(url) {
// ...
return baseURL + rootURL + url;
}, That suggests that this might be better called |
FWIW I agree that @jamesotron Have you started patching this |
@jayphelps I suspect you meant jamesarosen, not jamesotron. I haven't started any code yet. Here are some ideas:
In any of those cases, we can add deprecation warnings to the existing properties and have them modify the new properties as needed. Basically: the transition isn't hard once we know where we're going. |
@jamesarosen WHOOPS! I did indeed mean you. Sorry @jamesotron. Carry on. |
ha! will do. |
@jamesarosen I'm neck deep in the location classes and router again so I'm gonna try to squash this issue. Any additional thoughts or revelations since we last discussed or should I plow ahead? |
We experimented with a number of options. I think my (4) above is closest to what we ended up with. IE doesn't have |
@jayphelps status? |
@jayphelps / @jamesarosen - Is this still an issue? Any chance one of you would try whipping up a PR? |
@rwjblue I don't have the cycles to dig in right now 😞 |
Yes, I can take this on. Our next sprint starts next Monday. I can try to slate it in there. |
OK, so my plan is AutoLocation
HistoryLocation
TestsNot quite sure yet. |
@jamesarosen this would be a great addition, happy when I saw a fix is in the works! ⛵ |
@jamesarosen anything happening here? |
I had a PR, but it lingered and was closed. I stopped working on the app that this was a problem for about a year and a half ago. |
@jamesarosen thanks for the work! I'm closing this issue, sorry the PR didn't get merged at the time. |
Ember.HistoryLocation
setsbaseURL
tojQuery('base').attr('href') || ''
. That means thatbaseURL
is something likehttps://mysite.com/root/
.That's totally reasonable, except
HistoryLocation#getURL
usesbaseURL
as if it were just a path. That is, it calls (more or less)location.pathname.replace(baseURL, '')
.location.pathname
will never include the protocol and domain, so thatreplace
will never do anything.I believe the correct thing to do would be to extract
rootURL
frombaseURL
on initialization:Then, only use
rootURL
ingetURL
:The text was updated successfully, but these errors were encountered: