Skip to content

Commit 671994e

Browse files
committed
fix: declare proper charset and content-type
1 parent ed702e3 commit 671994e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ var auth = Authentic(config.authentic)
2121
var accessCache = new AsyncCache({
2222
load: function (k, cb) {
2323
db.get('_access', function (err, doc) {
24-
console.log('err', err)
2524
if (err) return cb(err)
2625
doc = doc || ''
2726
var list = doc
@@ -79,6 +78,7 @@ function main (req, res, opts) {
7978
var title = 'Wiki'
8079
var html = [
8180
'<html><head><title>' + title + '</title>',
81+
'<meta charset="utf-8">',
8282
'<meta name="viewport" content="width=device-width, initial-scale=1">',
8383
'<link rel="icon" type="image/png" href="/icon16.png"></head>',
8484
'<body><script src="main.js?v=' + version + '"></script></body></html>'
@@ -89,6 +89,7 @@ function main (req, res, opts) {
8989

9090
function getDoc (req, res, opts) {
9191
res.statusCode = 200
92+
res.setHeader('content-type', 'text/plain')
9293
db.getDocStream(opts.params.name).pipe(res)
9394
}
9495

0 commit comments

Comments
 (0)