Skip to content

Commit

Permalink
[fixed] Double-encoding of URLs
Browse files Browse the repository at this point in the history
This commit fixes what I was trying to fix in fe5ec39
  • Loading branch information
mjackson committed Feb 17, 2015
1 parent 3457bad commit db2607d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modules/locations/HashLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ var HashLocation = {

push: function (path) {
_actionType = LocationActions.PUSH;
window.location.hash = encodeURI(path);
window.location.hash = path;
},

replace: function (path) {
_actionType = LocationActions.REPLACE;
window.location.replace(
window.location.pathname + window.location.search + '#' + encodeURI(path)
window.location.pathname + window.location.search + '#' + path
);
},

Expand Down
4 changes: 2 additions & 2 deletions modules/locations/HistoryLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ var HistoryLocation = {
},

push: function (path) {
window.history.pushState({ path: path }, '', encodeURI(path));
window.history.pushState({ path: path }, '', path);
History.length += 1;
notifyChange(LocationActions.PUSH);
},

replace: function (path) {
window.history.replaceState({ path: path }, '', encodeURI(path));
window.history.replaceState({ path: path }, '', path);
notifyChange(LocationActions.REPLACE);
},

Expand Down
4 changes: 2 additions & 2 deletions modules/locations/RefreshLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ var History = require('../History');
var RefreshLocation = {

push: function (path) {
window.location = encodeURI(path);
window.location = path;
},

replace: function (path) {
window.location.replace(encodeURI(path));
window.location.replace(path);
},

pop: History.back,
Expand Down

0 comments on commit db2607d

Please sign in to comment.