wapplr 1.0.63 → 1.0.65
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.
|
@@ -282,12 +282,12 @@ function createMiddlewares(p) {
|
|
|
282
282
|
_sendData$stats = sendData.stats,
|
|
283
283
|
stats = _sendData$stats === void 0 ? {} : _sendData$stats,
|
|
284
284
|
_sendData$parsedPath = sendData.parsedPath,
|
|
285
|
-
parsedPath = _sendData$parsedPath === void 0 ? {} : _sendData$parsedPath
|
|
285
|
+
parsedPath = _sendData$parsedPath === void 0 ? {} : _sendData$parsedPath,
|
|
286
|
+
dontSetContentLength = sendData.dontSetContentLength;
|
|
286
287
|
var _html = data;
|
|
287
288
|
var _parsedPath$ext = parsedPath.ext,
|
|
288
|
-
ext = _parsedPath$ext === void 0 ? ".html" : _parsedPath$ext
|
|
289
|
-
|
|
290
|
-
charSet = _parsedPath$charSet === void 0 ? ext === '.html' ? 'utf-8' : '' : _parsedPath$charSet;
|
|
289
|
+
ext = _parsedPath$ext === void 0 ? ".html" : _parsedPath$ext;
|
|
290
|
+
var charSet = sendData.charSet ? sendData.charSet : ext === '.html' ? 'utf-8' : '';
|
|
291
291
|
var mtime = stats.mtime;
|
|
292
292
|
|
|
293
293
|
if (!res.getHeader("Accept-Ranges")) {
|
|
@@ -300,7 +300,7 @@ function createMiddlewares(p) {
|
|
|
300
300
|
}).join('; '));
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
if (!res.getHeader("Content-Length")) {
|
|
303
|
+
if (!res.getHeader("Content-Length") && !dontSetContentLength) {
|
|
304
304
|
res.setHeader("Content-Length", Buffer.byteLength(_html));
|
|
305
305
|
}
|
|
306
306
|
|