Skip to content

Commit 508bc86

Browse files
author
jaxoncreed
committed
Use path.sep
1 parent 364be6b commit 508bc86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/resource-mapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const { promisify } = require('util')
44
const { types, extensions } = require('mime-types')
55
const readdir = promisify(fs.readdir)
66
const HTTPError = require('./http-error')
7+
const pathUtil = require('path')
78

89
/*
910
* A ResourceMapper maintains the mapping between HTTP URLs and server filenames,
@@ -78,9 +79,8 @@ class ResourceMapper {
7879

7980
// Determine the URL by chopping off everything after the dollar sign
8081
const pathname = this._removeDollarExtension(path)
81-
console.log(pathname)
8282
const url = `${this.resolveUrl(hostname)}${
83-
pathname.split('/').map((component) => encodeURIComponent(component)).join('/')
83+
pathname.split(pathUtil.sep).map((component) => encodeURIComponent(component)).join('/')
8484
}`
8585
return { url, contentType: this._getContentTypeByExtension(path) }
8686
}

0 commit comments

Comments
 (0)