From c6a7164fd083b2f1b1561dd3fe9211556ba5fcc5 Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Sun, 12 Jun 2016 11:57:58 +0200 Subject: [PATCH] Fixed: Security exception when accessing "/" via a (``react-router``) ```` is now avoided. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #521 Can’t be correctly tested until we use run tests in some browsers… --- CHANGELOG.md | 4 ++++ src/client/index.js | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91e44b61f..112ae276d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +- Fixed: Security exception when accessing "/" via a + ``react-router`` ```` is now avoided. + ([#521](https://github.com/MoOx/phenomic/issues/521) - @MoOx) + # 0.14.1 - 2016-06-12 - Fixed: explicit update of ``react-router@^2.3.0`` peer dependency diff --git a/src/client/index.js b/src/client/index.js index f689075d4..008c1b5d4 100644 --- a/src/client/index.js +++ b/src/client/index.js @@ -12,7 +12,9 @@ import PhenomicContextProvider from "../ContextProvider" export const browserHistory = typeof window !== "undefined" // just for node testing ? useRouterHistory(createBrowserHistory)({ - basename: process.env.PHENOMIC_USER_PATHNAME, + // basename don't like having a trailing slash + // https://github.com/reactjs/react-router/issues/3184 + basename: process.env.PHENOMIC_USER_PATHNAME.replace(/\/$/, ""), }) : null