Skip to content

Commit

Permalink
fix(hitokoto): wrong content-type, close #4
Browse files Browse the repository at this point in the history
  • Loading branch information
a632079 committed Apr 13, 2020
1 parent 37fe368 commit 9357251
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/controllers/hitokoto.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async function hitokoto (ctx, next) {
ctx.set('Content-Type', 'application/json; charset=gbk')
ctx.body = iconv.encode(hitokotoFormat(sentence), 'GBK')
} else {
ctx.set('Content-Type', 'text/plain; charset=utf-8')
ctx.set('Content-Type', 'application/json; charset=utf-8')
ctx.body = flatstr(hitokotoFormat(sentence))
}
break
Expand Down Expand Up @@ -146,7 +146,7 @@ async function hitokoto (ctx, next) {
ctx.set('Content-Type', 'application/json; charset=gbk')
ctx.body = iconv.encode(hitokotoFormat(sentence), 'GBK')
} else {
ctx.set('Content-Type', 'text/plain; charset=utf-8')
ctx.set('Content-Type', 'application/json; charset=utf-8')
ctx.body = flatstr(hitokotoFormat(sentence))
}
break
Expand All @@ -164,7 +164,7 @@ async function hitokoto (ctx, next) {
ctx.set('Content-Type', 'application/json; charset=gbk')
ctx.body = iconv.encode(hitokotoFormat(sentence), 'GBK')
} else {
ctx.set('Content-Type', 'text/plain; charset=utf-8')
ctx.set('Content-Type', 'application/json; charset=utf-8')
ctx.body = flatstr(hitokotoFormat(sentence))
}
break
Expand Down Expand Up @@ -193,7 +193,7 @@ async function hitokoto (ctx, next) {
ctx.set('Content-Type', 'application/json; charset=gbk')
ctx.body = iconv.encode(hitokotoFormat(sentence), 'GBK')
} else {
ctx.set('Content-Type', 'text/plain; charset=utf-8')
ctx.set('Content-Type', 'application/json; charset=utf-8')
ctx.body = flatstr(hitokotoFormat(sentence))
}
break
Expand Down

0 comments on commit 9357251

Please sign in to comment.