Skip to content

Commit 549ccf1

Browse files
authored
Merge pull request #958 from solid/bugfix/windows-index
Fix index path creation on Windows
2 parents 96fcfc6 + 9e49d00 commit 549ccf1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/handlers/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const path = require('path')
44
const debug = require('debug')('solid:index')
55
const utils = require('../utils')
66
const Negotiator = require('negotiator')
7+
const url = require('url')
78

89
function handler (req, res, next) {
910
const indexFile = 'index.html'
@@ -33,7 +34,7 @@ function handler (req, res, next) {
3334
if (err) {
3435
return next()
3536
}
36-
res.locals.path = path.join(req.path, indexFile)
37+
res.locals.path = url.resolve(req.path, indexFile)
3738
debug('Found an index for current path')
3839
return next()
3940
})

0 commit comments

Comments
 (0)