Skip to content

Commit

Permalink
fix(middleware): Return after root redirect
Browse files Browse the repository at this point in the history
Fixes Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

Fixes #104
  • Loading branch information
paulgv committed Aug 10, 2018
1 parent 27edec3 commit c2ce741
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/templates/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ middleware['i18n'] = async ({ app, req, res, route, store, redirect, isHMR }) =>
const rootRedirect = '<%= options.rootRedirect %>'
if (route.path === '/' && rootRedirect) {
redirect('/' + rootRedirect)
return
}

// Handle browser language detection
Expand Down

0 comments on commit c2ce741

Please sign in to comment.