Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
803e4154b2 | ||
|
|
267913151b | ||
|
|
b1e36ccbf5 | ||
|
|
55e914660b | ||
|
|
0ff43c75a8 | ||
|
|
d15b5f1387 | ||
|
|
d5a4b93449 | ||
|
|
244f8a5541 | ||
|
|
ed11812d3f | ||
|
|
4881fb27da | ||
|
|
07e47b1e78 | ||
|
|
55a5939596 | ||
|
|
12d7cb4a7d | ||
|
|
c602a95d4c | ||
|
|
bf15ad0e12 |
32
HISTORY.md
32
HISTORY.md
@@ -1,3 +1,35 @@
|
||||
1.6.0 / 2015-01-01
|
||||
==================
|
||||
|
||||
* Add link to root directory
|
||||
* deps: accepts@~1.2.2
|
||||
- deps: mime-types@~2.0.7
|
||||
- deps: negotiator@0.5.0
|
||||
* deps: batch@0.5.2
|
||||
* deps: debug@~2.1.1
|
||||
* deps: mime-types@~2.0.7
|
||||
- Add new mime types
|
||||
- Fix missing extensions
|
||||
- Fix various invalid MIME type entries
|
||||
- Remove example template MIME types
|
||||
- deps: mime-db@~1.5.0
|
||||
|
||||
1.5.3 / 2014-12-10
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.1.4
|
||||
- deps: mime-types@~2.0.4
|
||||
* deps: http-errors@~1.2.8
|
||||
- Fix stack trace from exported function
|
||||
* deps: mime-types@~2.0.4
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.3.0
|
||||
|
||||
1.5.2 / 2014-12-03
|
||||
==================
|
||||
|
||||
* Fix icon name background alignment on mobile view
|
||||
|
||||
1.5.1 / 2014-11-22
|
||||
==================
|
||||
|
||||
|
||||
2
index.js
2
index.js
@@ -148,7 +148,7 @@ exports = module.exports = function serveIndex(root, options){
|
||||
|
||||
// content-negotiation
|
||||
var accept = accepts(req);
|
||||
var type = accept.types(mediaTypes);
|
||||
var type = accept.type(mediaTypes);
|
||||
|
||||
// not acceptable
|
||||
if (!type) return next(createError(406));
|
||||
|
||||
16
package.json
16
package.json
@@ -1,22 +1,22 @@
|
||||
{
|
||||
"name": "serve-index",
|
||||
"description": "Serve directory listings",
|
||||
"version": "1.5.1",
|
||||
"version": "1.6.0",
|
||||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"license": "MIT",
|
||||
"repository": "expressjs/serve-index",
|
||||
"dependencies": {
|
||||
"accepts": "~1.1.3",
|
||||
"batch": "0.5.1",
|
||||
"debug": "~2.1.0",
|
||||
"http-errors": "~1.2.7",
|
||||
"mime-types": "~2.0.3",
|
||||
"accepts": "~1.2.2",
|
||||
"batch": "0.5.2",
|
||||
"debug": "~2.1.1",
|
||||
"http-errors": "~1.2.8",
|
||||
"mime-types": "~2.0.7",
|
||||
"parseurl": "~1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"after": "0.8.1",
|
||||
"istanbul": "0.3.2",
|
||||
"mocha": "~2.0.1",
|
||||
"istanbul": "0.3.5",
|
||||
"mocha": "~2.1.0",
|
||||
"supertest": "~0.15.0"
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<body class="directory">
|
||||
<input id="search" type="text" placeholder="Search" autocomplete="off" />
|
||||
<div id="wrapper">
|
||||
<h1>{linked-path}</h1>
|
||||
<h1><a href="/">~</a>{linked-path}</h1>
|
||||
{files}
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -249,7 +249,7 @@ ul#files.view-details li.header {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
text-indent: 0;
|
||||
background-position: 0 0;
|
||||
background-position: 0 50%;
|
||||
}
|
||||
#files .icon .name {
|
||||
text-indent: 41px;
|
||||
|
||||
@@ -145,8 +145,9 @@ describe('serveIndex(root)', function () {
|
||||
.expect(200)
|
||||
.expect('Content-Type', 'text/html; charset=utf-8')
|
||||
.end(function (err, res) {
|
||||
if (err) throw err;
|
||||
var urls = res.text.split(/<a href="([^"]*)"/).filter(function(s, i){ return i%2; });
|
||||
if (err) done(err);
|
||||
var body = res.text.split('</h1>')[1];
|
||||
var urls = body.split(/<a href="([^"]*)"/).filter(function(s, i){ return i%2; });
|
||||
assert.deepEqual(urls, [
|
||||
'/%23directory',
|
||||
'/collect',
|
||||
|
||||
Reference in New Issue
Block a user