Add line breaks

This commit is contained in:
Shawn K 2018-12-17 19:52:51 -06:00 committed by GitHub
parent cbb94d5e55
commit c335810978
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,6 +49,7 @@ export default (req, res) => {
action = false,
saga = false,
} = httpContext.get('routeData');
if (action === 'fallback') {
res.status(404);
}
@ -117,13 +118,16 @@ export default (req, res) => {
.then(() => {
// redirect if request does not use canonical url
const canonicalUrl = getCanonicalUrlFromShow(store.getState().show);
if (!canonicalUrl) {
res.status(404);
}
if (canonicalUrl && canonicalUrl !== req.originalUrl) {
console.log(`redirecting ${req.originalUrl} to ${canonicalUrl}`);
res.redirect(canonicalUrl);
}
return renderPage(store)
});
} else {