From db2607d4d33322acb2c77c8906068015f2254c12 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Tue, 17 Feb 2015 10:48:27 -0800 Subject: [PATCH] [fixed] Double-encoding of URLs This commit fixes what I was trying to fix in fe5ec395f98e1d063539dd2211b590dd0840de59 --- modules/locations/HashLocation.js | 4 ++-- modules/locations/HistoryLocation.js | 4 ++-- modules/locations/RefreshLocation.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/locations/HashLocation.js b/modules/locations/HashLocation.js index caaa15a3d8..fac96c3d54 100644 --- a/modules/locations/HashLocation.js +++ b/modules/locations/HashLocation.js @@ -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 ); }, diff --git a/modules/locations/HistoryLocation.js b/modules/locations/HistoryLocation.js index a2a0c4cd55..2daf448ebd 100644 --- a/modules/locations/HistoryLocation.js +++ b/modules/locations/HistoryLocation.js @@ -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); }, diff --git a/modules/locations/RefreshLocation.js b/modules/locations/RefreshLocation.js index 36a3a632fc..ed26526b18 100644 --- a/modules/locations/RefreshLocation.js +++ b/modules/locations/RefreshLocation.js @@ -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,