mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-08 03:02:03 +01:00
make code easier to understand
This commit is contained in:
parent
f0fa6cfd30
commit
a11f5c1378
1 changed files with 2 additions and 5 deletions
|
@ -20,7 +20,6 @@ var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var zlib = require('zlib');
|
var zlib = require('zlib');
|
||||||
var settings = require('./Settings');
|
var settings = require('./Settings');
|
||||||
var semver = require('semver');
|
|
||||||
var existsSync = require('./path_exists');
|
var existsSync = require('./path_exists');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -192,16 +191,14 @@ CachingMiddleware.prototype = new function () {
|
||||||
res.write = old_res.write || res.write;
|
res.write = old_res.write || res.write;
|
||||||
res.end = old_res.end || res.end;
|
res.end = old_res.end || res.end;
|
||||||
|
|
||||||
var headers = responseCache[cacheKey].headers;
|
let headers = {};
|
||||||
|
Object.assign(headers, (responseCache[cacheKey].headers || {}));
|
||||||
var statusCode = responseCache[cacheKey].statusCode;
|
var statusCode = responseCache[cacheKey].statusCode;
|
||||||
|
|
||||||
var pathStr = CACHE_DIR + 'minified_' + cacheKey;
|
var pathStr = CACHE_DIR + 'minified_' + cacheKey;
|
||||||
if (supportsGzip && /^application\/javascript/.test(headers['content-type'])) {
|
if (supportsGzip && /^application\/javascript/.test(headers['content-type'])) {
|
||||||
pathStr = pathStr + '.gz';
|
pathStr = pathStr + '.gz';
|
||||||
headers['content-encoding'] = 'gzip';
|
headers['content-encoding'] = 'gzip';
|
||||||
} else {
|
|
||||||
// ensure responseCache is updated
|
|
||||||
delete headers['content-encoding'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastModified = (headers['last-modified']
|
var lastModified = (headers['last-modified']
|
||||||
|
|
Loading…
Reference in a new issue