Skip to content

Commit c2ce741

Browse files
committed
fix(middleware): Return after root redirect
Fixes Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client Fixes #104
1 parent 27edec3 commit c2ce741

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/templates/middleware.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ middleware['i18n'] = async ({ app, req, res, route, store, redirect, isHMR }) =>
2828
const rootRedirect = '<%= options.rootRedirect %>'
2929
if (route.path === '/' && rootRedirect) {
3030
redirect('/' + rootRedirect)
31+
return
3132
}
3233

3334
// Handle browser language detection

0 commit comments

Comments
 (0)