Fix tempFileMiddleware that was serving a cached .well-known file
Ticket: 1386 The code was caching the first result and returning that. We would expand the cache for multiple files, that that also require checking if the file has changed, so just read the content every time -- I think the file is small enough?
This commit is contained in:
parent
b9525229f9
commit
73d68c1db2
1 changed files with 1 additions and 5 deletions
|
@ -1,13 +1,9 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
let tempFile;
|
||||
async function getTempFile(ctx) {
|
||||
const filename = ctx.params.filename;
|
||||
if (!tempFile) {
|
||||
tempFile = fs.readFileSync(path.join(__dirname, `/../dist/${filename}`), 'utf8');
|
||||
}
|
||||
return tempFile;
|
||||
return fs.readFileSync(path.join(__dirname, `/../dist/${filename}`), 'utf8');
|
||||
}
|
||||
|
||||
module.exports = { getTempFile };
|
||||
|
|
Loading…
Reference in a new issue