@@ -6,7 +6,6 @@ const { promisify } = require('util')
66const { types, extensions } = require ( 'mime-types' )
77const readdir = promisify ( fs . readdir )
88const HTTPError = require ( './http-error' )
9- const pathUtil = require ( 'path' )
109
1110/*
1211 * A ResourceMapper maintains the mapping between HTTP URLs and server filenames,
@@ -30,7 +29,7 @@ class ResourceMapper {
3029 overrideTypes = { acl : 'text/turtle' , meta : 'text/turtle' }
3130 } ) {
3231 this . _rootUrl = this . _removeTrailingSlash ( rootUrl )
33- this . _rootPath = this . _removeTrailingSlash ( rootPath )
32+ this . _rootPath = this . _removeTrailingSlash ( rootPath ) . replace ( / \\ / g , '/' )
3433 this . _includeHost = includeHost
3534 this . _readdir = readdir
3635 this . _defaultContentType = defaultContentType
@@ -84,7 +83,7 @@ class ResourceMapper {
8483 // Determine the URL by chopping off everything after the dollar sign
8584 const pathname = this . _removeDollarExtension ( path )
8685 const url = `${ this . resolveUrl ( hostname ) } ${
87- pathname . split ( pathUtil . sep ) . map ( ( component ) => encodeURIComponent ( component ) ) . join ( '/' )
86+ pathname . split ( '/' ) . map ( ( component ) => encodeURIComponent ( component ) ) . join ( '/' )
8887 } `
8988 return { url, contentType : this . _getContentTypeFromExtension ( path ) }
9089 }
0 commit comments