Skip to content

Commit 0728bc2

Browse files
committed
fix: do not hardcode external pages in server handling
1 parent a1a3e45 commit 0728bc2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/server.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,17 @@ if (config.disguiseFiles) {
170170
const getActualPath = (path) =>
171171
path.slice(0, path.length - 1 - disguise.length),
172172
isNotHtml = /\.(?!html$)[\w-]+$/i,
173-
exemptDirs = ['github', 'assets/ico'],
174173
loaderFile = tryReadFile(
175174
'../views/dist/pages/misc/deobf/loader.html',
176175
import.meta.url,
177176
false
178177
);
179-
let exemptPages = ['login', 'test-shutdown', 'favicon.ico'];
178+
let exemptDirs = ['assets/ico'],
179+
exemptPages = ['login', 'test-shutdown', 'favicon.ico'];
180+
Object.entries(externalPages).forEach(([key, value]) => {
181+
if ('string' === typeof value) exemptPages.push(key);
182+
else exemptDirs.push(key);
183+
});
180184
if (pages.default === 'login') exemptPages.push('');
181185
app.addHook('preHandler', (req, reply, done) => {
182186
if (req.params.modified) return done();

0 commit comments

Comments
 (0)