koa-static-cache
Advanced tools
Comparing version 5.1.2 to 5.1.3
5.1.3 / 2020-04-29 | ||
================== | ||
**fixes** | ||
* [[`dca1edf`](http://github.com/koajs/static-cache/commit/dca1edf0b641993921b33c0289dbd73ff4bc1c13)] - fix: alias should work when preload = false (#84) (TZ | 天猪 <<atian25@qq.com>>) | ||
5.1.2 / 2018-02-06 | ||
@@ -3,0 +9,0 @@ ================== |
17
index.js
@@ -37,14 +37,2 @@ var crypto = require('crypto') | ||
if (options.alias) { | ||
Object.keys(options.alias).forEach(function (key) { | ||
var value = options.alias[key] | ||
if (files.get(value)) { | ||
files.set(key, files.get(value)) | ||
debug('aliasing ' + value + ' as ' + key) | ||
} | ||
}) | ||
} | ||
return async (ctx, next) => { | ||
@@ -59,4 +47,7 @@ // only accept HEAD and GET | ||
var filename = path.normalize(safeDecodeURIComponent(ctx.path)) | ||
// check alias | ||
if (options.alias && options.alias[filename]) filename = options.alias[filename]; | ||
var file = files.get(filename) | ||
// try to load file | ||
@@ -63,0 +54,0 @@ if (!file) { |
{ | ||
"name": "koa-static-cache", | ||
"description": "Static cache for koa", | ||
"version": "5.1.2", | ||
"version": "5.1.3", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jonathan Ong", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16542
183