Skip to content

Commit db2607d

Browse files
committed
[fixed] Double-encoding of URLs
This commit fixes what I was trying to fix in fe5ec39
1 parent 3457bad commit db2607d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

modules/locations/HashLocation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ var HashLocation = {
9595

9696
push: function (path) {
9797
_actionType = LocationActions.PUSH;
98-
window.location.hash = encodeURI(path);
98+
window.location.hash = path;
9999
},
100100

101101
replace: function (path) {
102102
_actionType = LocationActions.REPLACE;
103103
window.location.replace(
104-
window.location.pathname + window.location.search + '#' + encodeURI(path)
104+
window.location.pathname + window.location.search + '#' + path
105105
);
106106
},
107107

modules/locations/HistoryLocation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ var HistoryLocation = {
6565
},
6666

6767
push: function (path) {
68-
window.history.pushState({ path: path }, '', encodeURI(path));
68+
window.history.pushState({ path: path }, '', path);
6969
History.length += 1;
7070
notifyChange(LocationActions.PUSH);
7171
},
7272

7373
replace: function (path) {
74-
window.history.replaceState({ path: path }, '', encodeURI(path));
74+
window.history.replaceState({ path: path }, '', path);
7575
notifyChange(LocationActions.REPLACE);
7676
},
7777

modules/locations/RefreshLocation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ var History = require('../History');
99
var RefreshLocation = {
1010

1111
push: function (path) {
12-
window.location = encodeURI(path);
12+
window.location = path;
1313
},
1414

1515
replace: function (path) {
16-
window.location.replace(encodeURI(path));
16+
window.location.replace(path);
1717
},
1818

1919
pop: History.back,

0 commit comments

Comments
 (0)