Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/supertest-6.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang authored May 18, 2021
2 parents 830433e + c3294cf commit bb29304
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 20
ignore:
- dependency-name: open
versions:
- 8.0.1
- 8.0.2
- 8.0.3
- 8.0.4
- 8.0.5
- 8.0.6
- dependency-name: sinon
versions:
- 10.0.0
14 changes: 12 additions & 2 deletions lib/middlewares/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const mime = require('mime');
module.exports = function(app) {
const { config, route } = this;
const { args = {} } = this.env;
const { root } = config;
const { root, feed } = config;

if (args.s || args.static) return;

Expand Down Expand Up @@ -63,7 +63,17 @@ module.exports = function(app) {
return;
}

res.setHeader('Content-Type', extname ? mime.getType(extname) : 'application/octet-stream');
if (feed && feed.path === url) {
if (feed.type === 'atom') {
res.setHeader('Content-Type', 'application/atom+xml');
} else if (feed.type === 'rss') {
res.setHeader('Content-Type', 'application/rss+xml');
} else {
res.setHeader('Content-Type', extname ? mime.getType(extname) : 'application/octet-stream');
}
} else {
res.setHeader('Content-Type', extname ? mime.getType(extname) : 'application/octet-stream');
}

if (method === 'GET') {
data.pipe(res).on('error', next);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"connect": "^3.7.0",
"mime": "^2.4.3",
"morgan": "^1.9.1",
"open": "^7.0.0",
"open": "^8.0.9",
"serve-static": "^1.14.1"
},
"devDependencies": {
Expand All @@ -47,7 +47,7 @@
"hexo-util": "^2.1.0",
"mocha": "^8.0.1",
"nyc": "^15.0.0",
"sinon": "^9.0.2",
"sinon": "^10.0.1",
"supertest": "^6.1.3",
"uuid": "^8.0.0"
},
Expand Down

0 comments on commit bb29304

Please sign in to comment.