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

Commit

Permalink
fix: support absolute URL in client-side getInitialData redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaSemenov committed Oct 10, 2018
1 parent 979cf2a commit 06e59bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/client-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ const updateDataStore = (id, data) => {
const handleError = err => {
if (err instanceof ReamError) {
if (err.code === 'REDIRECT') {
router.push(err.redirectURL)
const url = err.redirectURL
if (/^(\w+:)?\/\//.test(url)) {
window.location.assign(url)
} else {
router.push(url)
}
} else {
app.setError(err)
}
Expand Down

0 comments on commit 06e59bd

Please sign in to comment.