🐛 Corrige les redirections javascript

pull/1465/head
Johan Girod 2021-03-24 09:43:29 +01:00
parent 0e85017069
commit 64c7ce7f88
1 changed files with 2 additions and 2 deletions

View File

@ -4,8 +4,8 @@ import netlifyToml from '../../netlify.toml'
export default netlifyToml.redirects
.filter(({ from, status }) => status === 301 && !from.startsWith('https'))
.map(({ from, to }) => ({
from: decodeURIComponent(from.replace(/^:.*\//, '')),
to: decodeURIComponent(to.replace(/^:.*\//, '').replace(':splat', '*')),
from: decodeURIComponent(from.replace(/^:.*?\//, '/')),
to: decodeURIComponent(to.replace(/^:.*?\//, '/').replace(':splat', '*')),
}))
.filter(({ from, to }) => from != to)
.map((props) => <Redirect key={props.from} {...props} exact />)