From a222edd395aac9476b1e37ec192198e145e6acde Mon Sep 17 00:00:00 2001 From: Alexey Romanov Date: Fri, 14 Oct 2016 04:41:30 +0300 Subject: [PATCH] Redirect from non-slash to slash page, fixes #452. --- lib/utils/develop.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/utils/develop.js b/lib/utils/develop.js index b1ded0397f108..9dfb01cb023ff 100644 --- a/lib/utils/develop.js +++ b/lib/utils/develop.js @@ -127,6 +127,10 @@ function startServer (program) { } else if (request.path === '/bundle.js') { reply.continue() } else if (negotiator.mediaType() === 'text/html') { + // If the path does not end with a slash, add it. + if (request.path[request.path.length - 1] !== '/') { + request.path += '/'; + } request.setUrl(`/html${request.path}`) reply.continue() } else {