Comparing version 0.4.6 to 0.4.7
@@ -104,3 +104,5 @@ #! /usr/bin/env node | ||
res.statusCode = 302; | ||
res.setHeader('location', pathname + '/'); | ||
res.setHeader('location', pathname + '/' + ( | ||
parsed.query ? '?' + parsed.query : '' | ||
)); | ||
return res.end(); | ||
@@ -107,0 +109,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "A simple static file server middleware that works with both Express and Flatiron", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"homepage": "https://github.com/jesusabdullah/node-ecstatic", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -46,4 +46,9 @@ var test = require('tap').test, | ||
'subdir' : { | ||
code : 302 | ||
code : 302, | ||
location: 'subdir/' | ||
}, | ||
'subdir?foo=bar': { | ||
code: 302, | ||
location: 'subdir/?foo=bar' | ||
}, | ||
'subdir/' : { | ||
@@ -111,2 +116,6 @@ code : 200, | ||
} | ||
if (r.location !== undefined) { | ||
t.equal(res.headers.location, path.join('/', baseDir, r.location), 'location for `' + file + '`'); | ||
} | ||
@@ -113,0 +122,0 @@ if (--pending === 0) { |
Sorry, the diff of this file is not supported yet
225314
862