forked from svrjs/svrjs
Improved extension checking function and corrected 503 error description
This commit is contained in:
parent
f37a565ca1
commit
61dead9b4a
2 changed files with 29 additions and 30 deletions
|
@ -3,7 +3,7 @@
|
|||
"port": 80,
|
||||
"pubport": 80,
|
||||
"page404": "404.html",
|
||||
"timestamp": 1691626302396,
|
||||
"timestamp": 1691836531788,
|
||||
"blacklist": [],
|
||||
"nonStandardCodes": [],
|
||||
"enableCompression": true,
|
||||
|
|
5
svr.js
5
svr.js
|
@ -3168,7 +3168,7 @@ if (!cluster.isPrimary) {
|
|||
500: "The server had an unexpected error. Below, the error stack is shown: </p><code>{stack}</code><p>Please contact with developer/administrator at <i>{contact}</i>.",
|
||||
501: "The request requires use of a function, which isn't currently implemented by the server.",
|
||||
502: "The server had an error, while it was acting as a gateway.</p><p>Please contact with developer/administrator at <i>{contact}</i>.",
|
||||
503: "The service provided by the server is currently unavailable, possibly due of maintenance downtime or capacity problems. Please try again later.</p><p>Please contact with developer/administrator at <i>{contact}</i>.",
|
||||
503: "The service provided by the server is currently unavailable, possibly due to maintenance downtime or capacity problems. Please try again later.</p><p>Please contact with developer/administrator at <i>{contact}</i>.",
|
||||
504: "The server couldn't get response in time, while it was acting as a gateway.</p><p>Please contact with developer/administrator at <i>{contact}</i>.",
|
||||
505: "The server doesn't support HTTP version used in the request.",
|
||||
506: "Variant header is configured to be engaged in content negotiation.</p><p>Please contact with developer/administrator at <i>{contact}</i>.",
|
||||
|
@ -3815,8 +3815,7 @@ if (!cluster.isPrimary) {
|
|||
getStatsForAllFiles(list, "." + decodeURIComponent(href), function (filelist) {
|
||||
// Function to check file extension
|
||||
function checkEXT(filename, ext) {
|
||||
if (filename.length < ext.length) return false;
|
||||
return filename.toLowerCase().indexOf(ext) === filename.length - ext.length;
|
||||
return filename.match(new RegExp("\\." + ext.replace(/([.+*?^$()\[\]{}|\\])/,"\\$1") + "$","i"));
|
||||
}
|
||||
|
||||
var directoryListingRows = [];
|
||||
|
|
Reference in a new issue