mm_statics 1.7.5 → 1.7.6

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.
Files changed (2) hide show
  1. package/index.js +3 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -677,11 +677,12 @@ Static.prototype._pathToRoot = function (path) {
677
677
  */
678
678
  Static.prototype.main = async function (ctx, next) {
679
679
  let url = ctx.url; // 使用完整URL(包含查询参数)
680
- if (!ctx.path.startsWith(this.config.path)) {
680
+ let p = ctx.path;
681
+ if (p.indexOf('.') === -1 || !p.startsWith(this.config.path)) {
681
682
  await next();
682
683
  return '';
683
684
  }
684
- let path = this._getRealPath(ctx.path);
685
+ let path = this._getRealPath(p);
685
686
 
686
687
  // 检查缓存
687
688
  if (await this._handleCache(url, ctx)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_statics",
3
- "version": "1.7.5",
3
+ "version": "1.7.6",
4
4
  "description": "这是超级美眉statics函数模块,用于web服务端statics缓存",
5
5
  "main": "index.js",
6
6
  "scripts": {