projects
/
squeep-api-dingus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
log a little less about static meta headers
[squeep-api-dingus]
/
lib
/
dingus.js
diff --git
a/lib/dingus.js
b/lib/dingus.js
index d4af0e102d63d576cbe1cc71956ee7165bff9b6f..0a5f9d8d50badb5dc0ceb3b4a3c4d876a87cc58e 100644
(file)
--- a/
lib/dingus.js
+++ b/
lib/dingus.js
@@
-520,8
+520,8
@@
class Dingus {
*/
async _serveFileMetaHeaders(res, directory, fileName) {
const _scope = _fileScope('_serveFileMetaHeaders');
*/
async _serveFileMetaHeaders(res, directory, fileName) {
const _scope = _fileScope('_serveFileMetaHeaders');
- this.logger.debug(_scope, 'called', { directory, fileName });
+ let added = false;
const metaPrefix = '.';
const metaSuffix = '.meta';
const metaFileName = `${metaPrefix}${fileName}${metaSuffix}`;
const metaPrefix = '.';
const metaSuffix = '.meta';
const metaFileName = `${metaPrefix}${fileName}${metaSuffix}`;
@@
-529,7
+529,7
@@
class Dingus {
const [stat, data] = await this._readFileInfo(metaFilePath);
if (!stat) {
const [stat, data] = await this._readFileInfo(metaFilePath);
if (!stat) {
- return;
+ return
added
;
}
const lineBreakRE = /\r\n|\n|\r/;
}
const lineBreakRE = /\r\n|\n|\r/;
@@
-542,8
+542,10
@@
class Dingus {
const result = headerParseRE.exec(line);
const { groups: header } = result;
res.setHeader(header.name, header.value);
const result = headerParseRE.exec(line);
const { groups: header } = result;
res.setHeader(header.name, header.value);
+ added = true;
}
});
}
});
+ return added;
}
}
@@
-636,7
+638,7
@@
class Dingus {
res.setHeader(Enum.Header.CacheControl, 'public');
if (this.staticMetadata) {
res.setHeader(Enum.Header.CacheControl, 'public');
if (this.staticMetadata) {
- await this._serveFileMetaHeaders(res, directory, fileName);
+
ctx.metaHeaders =
await this._serveFileMetaHeaders(res, directory, fileName);
}
this.logger.debug(_scope, 'serving file', { filePath, contentType });
}
this.logger.debug(_scope, 'serving file', { filePath, contentType });