Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
update to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse committed Mar 8, 2014
1 parent c43b117 commit 53b8398
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controllers/web/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ exports.search = function *(next) {
packages: result.searchMatchs,
keywords: result.keywordMatchs
};
this.charset = 'utf-8';
this.type = 'application/json; charset=utf-8';

This comment has been minimized.

Copy link
@fengmk2

fengmk2 Mar 11, 2014

Member

厄, 这样会很别扭吧, 本来 content-type 会默认设置成 application/json 的, 看来得写一个 response filter middleware来统计设置了. 如果是 text, json, 并且没有设置charset, 就在 type后面加上charset

This comment has been minimized.

Copy link
@dead-horse

dead-horse Mar 11, 2014

Author Member

this.body = {} 会被强行设置上 content-type
可以在最后加个中间件来做

This comment has been minimized.

Copy link
@fengmk2

fengmk2 Mar 11, 2014

Member

按正常来说, text都会被默认加上 utf8的.. 不知道为何没了
image

return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports.getCDNKey = function (name, filename) {

exports.setDownloadURL = function (pkg, ctx, host) {
if (pkg.dist) {
host = host || ctx.get('host') || ctx.host;
host = host || ctx.host;
pkg.dist.tarball = util.format('%s://%s/%s/download/%s-%s.tgz',
ctx.protocol,
host, pkg.name, pkg.name, pkg.version);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"graceful": "0.0.6",
"gravatar": "1.0.6",
"humanize-number": "0.0.2",
"koa": "0.5.0",
"koa": "0.5.1",
"koa-markdown": "0.0.2",
"koa-middlewares": "0.0.8",
"logfilestream": "0.1.0",
Expand All @@ -41,7 +41,7 @@
"ready": "0.1.1",
"semver": "2.2.1",
"thunkify-wrap": "0.0.5",
"urllib": "0.5.6",
"urllib": "0.5.8",
"utility": "0.1.10"
},
"devDependencies": {
Expand Down

0 comments on commit 53b8398

Please sign in to comment.