Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
Fixed: Security exception when accessing "/" via a (react-router)…
Browse files Browse the repository at this point in the history
… ``<Link to="/"">`` is now avoided.

Closes #521

Can’t be correctly tested until we use run tests in some browsers…
  • Loading branch information
MoOx committed Jun 12, 2016
1 parent 1e6d472 commit c6a7164
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- Fixed: Security exception when accessing "/" via a
``react-router`` ``<Link to="/"">`` 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
Expand Down
4 changes: 3 additions & 1 deletion src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c6a7164

Please sign in to comment.