git ssb

30+

cel / git-ssb-web



Commit 6afe4bb561793e9e92fa37a07a07e36f43af45df

Serve plain text as utf-8

Charles Lehner committed on 3/23/2016, 3:39:22 AM
Parent: 0280bd8f7e0ed8a70224173c93b930022fb02225

Files changed

index.jschanged
index.jsView
@@ -144,9 +144,9 @@
144144 function getContentType(filename) {
145145 var ext = filename.split('.').pop()
146146 return hasOwnProp.call(contentTypes, ext)
147147 ? contentTypes[ext]
148- : 'text/plain'
148+ : 'text/plain; charset=utf-8'
149149 }
150150
151151 var contentTypes = {
152152 css: 'text/css'
@@ -282,9 +282,9 @@
282282 function servePlainError(code, msg) {
283283 return pull.values([
284284 [code, {
285285 'Content-Length': Buffer.byteLength(msg),
286- 'Content-Type': 'text/plain'
286+ 'Content-Type': 'text/plain; charset=utf-8'
287287 }],
288288 msg
289289 ])
290290 }
@@ -895,9 +895,9 @@
895895
896896 function serveRaw(length) {
897897 var inBody
898898 var headers = {
899- 'Content-Type': 'text/plain',
899+ 'Content-Type': 'text/plain; charset=utf-8',
900900 'Cache-Control': 'max-age=31536000'
901901 }
902902 if (length != null)
903903 headers['Content-Length'] = length

Built with git-ssb-web