Skip to content

Commit

Permalink
refactor(redirect): Simplify redirects()
Browse files Browse the repository at this point in the history
  • Loading branch information
kulla committed Nov 20, 2023
1 parent 400cac1 commit ea313d2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export async function redirects(request: Request, env: CFEnvironment) {
case '/datenschutz':
return Response.redirect('https://de.serlo.org/privacy', 301)
case '/impressum':
return Response.redirect('https://de.serlo.org/legal', 301)
case '/imprint':
return Response.redirect('https://de.serlo.org/legal', 301)
case '/nutzungsbedingungen':
Expand Down Expand Up @@ -111,12 +110,10 @@ export async function redirects(request: Request, env: CFEnvironment) {

if (url.subdomain === 'meet') {
const meetRedirect = meetRedirects[url.pathname]
return Response.redirect(
meetRedirect
? `https://meet.google.com/${meetRedirect}`
: 'https://serlo.org/___cf_not_found',
302,
)
const redirectUrl = meetRedirect
? `https://meet.google.com/${meetRedirect}`
: 'https://serlo.org/___cf_not_found'
return Response.redirect(redirectUrl, 302)
}

if (
Expand Down

0 comments on commit ea313d2

Please sign in to comment.