Skip to content

Commit

Permalink
Redirect from non-slash to slash page, fixes #452. (#505)
Browse files Browse the repository at this point in the history
* Redirect from non-slash to slash page, fixes #452.
  • Loading branch information
babruix authored and KyleAMathews committed Oct 17, 2016
1 parent ab3265d commit a978597
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/utils/develop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 += '/' // eslint-disable-line no-param-reassign
}
request.setUrl(`/html${request.path}`)
reply.continue()
} else {
Expand Down

0 comments on commit a978597

Please sign in to comment.