wapplr 1.0.62 → 1.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -285,7 +285,9 @@ function createMiddlewares(p) {
|
|
|
285
285
|
parsedPath = _sendData$parsedPath === void 0 ? {} : _sendData$parsedPath;
|
|
286
286
|
var _html = data;
|
|
287
287
|
var _parsedPath$ext = parsedPath.ext,
|
|
288
|
-
ext = _parsedPath$ext === void 0 ? ".html" : _parsedPath$ext
|
|
288
|
+
ext = _parsedPath$ext === void 0 ? ".html" : _parsedPath$ext,
|
|
289
|
+
_parsedPath$charSet = parsedPath.charSet,
|
|
290
|
+
charSet = _parsedPath$charSet === void 0 ? ext === '.html' ? 'utf-8' : '' : _parsedPath$charSet;
|
|
289
291
|
var mtime = stats.mtime;
|
|
290
292
|
|
|
291
293
|
if (!res.getHeader("Accept-Ranges")) {
|
|
@@ -293,7 +295,9 @@ function createMiddlewares(p) {
|
|
|
293
295
|
}
|
|
294
296
|
|
|
295
297
|
if (!res.getHeader("Content-Type")) {
|
|
296
|
-
res.setHeader("Content-Type", mimeType[ext] || "text/plain")
|
|
298
|
+
res.setHeader("Content-Type", [mimeType[ext] || "text/plain", charSet ? 'charset=' + charSet : ''].filter(function (t) {
|
|
299
|
+
return t;
|
|
300
|
+
}).join('; '));
|
|
297
301
|
}
|
|
298
302
|
|
|
299
303
|
if (!res.getHeader("Content-Length")) {
|