Skip to content

Commit

Permalink
Fix checking file ext in resource loader
Browse files Browse the repository at this point in the history
PR-URL: #1836
  • Loading branch information
tshemsedinov committed Jun 5, 2023
1 parent b94f6bd commit 914b264
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Application extends events.EventEmitter {

this.schemas = new Schemas('schemas', this);
this.static = new Resources('static', this);
this.cert = new Certificates('cert', this, { ext: '.pem' });
this.cert = new Certificates('cert', this, { ext: ['pem', 'domains'] });
this.resources = new Resources('resources', this);
this.api = new Interfaces('api', this);
this.lib = new Modules('lib', this);
Expand Down
3 changes: 2 additions & 1 deletion lib/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class Resources extends Cache {
}

async change(filePath) {
if (this.ext && !filePath.endsWith(filePath)) return;
const ext = metautil.fileExt(filePath);
if (this.ext && !this.ext.includes(ext)) return;
try {
const data = await fsp.readFile(filePath);
const key = this.getKey(filePath);
Expand Down

0 comments on commit 914b264

Please sign in to comment.