Skip to content

Commit cb5f79e

Browse files
author
Ed Epstein
committed
GitHub Issue angular#15856 -- Fix query portion parsing when not in html5 mode.
1 parent b9d2b30 commit cb5f79e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: src/ng/location.js

+13
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ function stripBaseUrl(base, url) {
7070
}
7171
}
7272

73+
function findSearch(url)
74+
{
75+
var index = url.indexOf('?');
76+
return index === -1 ? false : url.substr(index, url.length);
77+
}
7378

7479
function stripHash(url) {
7580
var index = url.indexOf('#');
@@ -206,6 +211,14 @@ function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
206211
withoutHashUrl = withoutBaseUrl;
207212
}
208213

214+
// apply any search params from the actual url to the withoutHashUrl
215+
// appBase will already have the hash taken off at this point.
216+
var search = findSearch(appBase);
217+
if (search !== false)
218+
{
219+
withoutHashUrl = withoutHashUrl + search;
220+
}
221+
209222
} else {
210223
// There was no hashbang path nor hash fragment:
211224
// If we are in HTML5 mode we use what is left as the path;

0 commit comments

Comments
 (0)