Commit 6afe4bb561793e9e92fa37a07a07e36f43af45df
Serve plain text as utf-8
Charles Lehner committed on 3/23/2016, 3:39:22 AMParent: 0280bd8f7e0ed8a70224173c93b930022fb02225
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -144,9 +144,9 @@ | ||
144 | 144 | function getContentType(filename) { |
145 | 145 | var ext = filename.split('.').pop() |
146 | 146 | return hasOwnProp.call(contentTypes, ext) |
147 | 147 | ? contentTypes[ext] |
148 | - : 'text/plain' | |
148 | + : 'text/plain; charset=utf-8' | |
149 | 149 | } |
150 | 150 | |
151 | 151 | var contentTypes = { |
152 | 152 | css: 'text/css' |
@@ -282,9 +282,9 @@ | ||
282 | 282 | function servePlainError(code, msg) { |
283 | 283 | return pull.values([ |
284 | 284 | [code, { |
285 | 285 | 'Content-Length': Buffer.byteLength(msg), |
286 | - 'Content-Type': 'text/plain' | |
286 | + 'Content-Type': 'text/plain; charset=utf-8' | |
287 | 287 | }], |
288 | 288 | msg |
289 | 289 | ]) |
290 | 290 | } |
@@ -895,9 +895,9 @@ | ||
895 | 895 | |
896 | 896 | function serveRaw(length) { |
897 | 897 | var inBody |
898 | 898 | var headers = { |
899 | - 'Content-Type': 'text/plain', | |
899 | + 'Content-Type': 'text/plain; charset=utf-8', | |
900 | 900 | 'Cache-Control': 'max-age=31536000' |
901 | 901 | } |
902 | 902 | if (length != null) |
903 | 903 | headers['Content-Length'] = length |
Built with git-ssb-web