1
0
Fork 0
forked from svrjs/svrjs

Cleaned up SVR.JS code

This commit is contained in:
Dorian Niemiec 2023-09-03 10:18:52 +02:00
parent a663b4f142
commit 9946c301e4
2 changed files with 1556 additions and 1556 deletions

View file

@ -3,7 +3,7 @@
"port": 80,
"pubport": 80,
"page404": "404.html",
"timestamp": 1693678972031,
"timestamp": 1693728019823,
"blacklist": [],
"nonStandardCodes": [],
"enableCompression": true,

2
svr.js
View file

@ -3519,7 +3519,7 @@ if (!cluster.isPrimary) {
: "";
// Check if custom header has HTML tag
var headerHasHTMLTag = customDirListingHeader.replace(/<!--(?:(?:(?!--\>).)*|)(?:-->|$)/gs, "").match(/<html(?![a-zA-Z0-9])(?:"(?:\\(?:.|$)|[^\\"])*(?:"|$)|'(?:\\(?:.|$)|[^\\'])*(?:'|$)|[^'">])*(?:>|$)/si);
var headerHasHTMLTag = customDirListingHeader.replace(/<!--(?:(?:(?!--\>)[\s\S])*|)(?:-->|$)/g, "").match(/<html(?![a-zA-Z0-9])(?:"(?:\\(?:[\s\S]|$)|[^\\"])*(?:"|$)|'(?:\\(?:[\s\S]|$)|[^\\'])*(?:'|$)|[^'">])*(?:>|$)/i);
// Generate HTML head and footer based on configuration and custom content
var htmlHead = (!configJSON.enableDirectoryListingWithDefaultHead || head == ""