Commit 4d9116f3 authored by Matija Obreza's avatar Matija Obreza

Merge branch '757-express-prevent-lang-lang-lang' into 'master'

Express: Prevent /lang/lang/lang

Closes #757

See merge request genesys-pgr/genesys-ui!736
parents 8d269814 0251ce9b
......@@ -137,9 +137,9 @@ const prerenderer = (html, errHtml) => (req, res) => {
const languageLinks = languages.map((lang) => {
if (lang.short === 'en') {
return `<link rel="alternate" hreflang="${lang.short}" href="${req.protocol + '://' + req.get('host')}${req.url}" />`;
return `<link rel="alternate" hreflang="${lang.short}" href="${req.protocol + '://' + req.get('host')}${pathWithoutLang}" />`;
} else {
return `<link rel="alternate" hreflang="${lang.short}" href="${req.protocol + '://' + req.get('host')}/${lang.short}${req.url}" />`;
return `<link rel="alternate" hreflang="${lang.short}" href="${req.protocol + '://' + req.get('host')}/${lang.short}${pathWithoutLang}" />`;
}
});
......
......@@ -91,6 +91,10 @@ const routes = [
title: 'My Dashboard',
},
},
{
component: NotFound,
status: 404,
},
],
},
// Admin
......@@ -120,6 +124,10 @@ const routes = [
title: 'Admin dashboard',
},
},
{
component: NotFound,
status: 404,
},
],
},
{
......@@ -163,6 +171,10 @@ const routes = [
// Taxonomy
...taxonomyPublicRoutes,
...divtreePublicRoutes,
{
component: NotFound,
status: 404,
},
],
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment