CachingMiddleware: Switch to ES6 class syntax
parent
80af66543a
commit
0284d49522
|
@ -77,10 +77,8 @@ if (_crypto) {
|
||||||
should replace this.
|
should replace this.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function CachingMiddleware() {
|
module.exports = class CachingMiddleware {
|
||||||
}
|
handle(req, res, next) {
|
||||||
CachingMiddleware.prototype = new function () {
|
|
||||||
const handle = (req, res, next) => {
|
|
||||||
if (!(req.method === 'GET' || req.method === 'HEAD') || !CACHE_DIR) {
|
if (!(req.method === 'GET' || req.method === 'HEAD') || !CACHE_DIR) {
|
||||||
return next(undefined, req, res);
|
return next(undefined, req, res);
|
||||||
}
|
}
|
||||||
|
@ -214,9 +212,5 @@ CachingMiddleware.prototype = new function () {
|
||||||
|
|
||||||
next(undefined, req, res);
|
next(undefined, req, res);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
};
|
||||||
this.handle = handle;
|
|
||||||
}();
|
|
||||||
|
|
||||||
module.exports = CachingMiddleware;
|
|
||||||
|
|
Loading…
Reference in New Issue