Skip to content

Commit

Permalink
Redirect from non-slash to slash page, fixes gatsbyjs#452.
Browse files Browse the repository at this point in the history
  • Loading branch information
babruix authored Oct 14, 2016
1 parent 37944c5 commit a222edd
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 += '/';
}
request.setUrl(`/html${request.path}`)
reply.continue()
} else {
Expand Down

0 comments on commit a222edd

Please sign in to comment.