Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

handle paths properly in Windows

  • Loading branch information...
commit 8aa6cc3725aa0df6e5d84d114a49532a58664f0e 1 parent 0eda184
Rod Vagg rvagg authored committed
Showing with 2 additions and 1 deletion.
  1. +1 −1  st.js
  2. +1 −0  test/basic.js
2  st.js
View
@@ -169,7 +169,7 @@ Mount.prototype.getCacheOptions = function (opt) {
// get a path from a url
Mount.prototype.getPath = function (u) {
- u = path.join('/', url.parse(u).pathname).replace(/\\/g, '/')
+ u = path.normalize(url.parse(u).pathname.replace(/^[\/\\]?/, '/')).replace(/\\/g, '/')
if (u.indexOf(this.url) !== 0) return false;
// /a/b/c mounted on /path/to/z/d/x
1  test/basic.js
View
@@ -49,6 +49,7 @@ var stExpect = fs.readFileSync(require.resolve('../st.js')).toString()
test('simple request', function (t) {
req('/test/st.js', function (er, res, body) {
t.equal(res.statusCode, 200)
+ t.ok(/\/javascript$/.test(res.headers['content-type']))
t.ok(res.headers.etag)
stEtag = res.headers.etag
t.equal(body.toString(), stExpect)
Please sign in to comment.
Something went wrong with that request. Please try again.