* Added ability to serve static files from web server

* Web server can have custom error pages, e.g. 404.html
* "file_area" stuff -> "file_base"
* Fix some rare bugs in theme/art loading
* Adjust tab order dynamically for file upload details
This commit is contained in:
Bryan Ashby 2017-02-04 09:20:36 -07:00
parent ff64a7aed5
commit 92772eb1a9
14 changed files with 165 additions and 48 deletions

View file

@ -78,7 +78,7 @@ function getArtFromPath(path, options, cb) {
return iconv.decode(data, encoding);
} else {
const eofMarker = defaultEofFromExtension(ext);
return iconv.decode(sliceAtEOF(data, eofMarker), encoding);
return iconv.decode(eofMarker ? sliceAtEOF(data, eofMarker) : data, encoding);
}
}
@ -213,11 +213,15 @@ function getArt(name, options, cb) {
}
function defaultEncodingFromExtension(ext) {
return SUPPORTED_ART_TYPES[ext.toLowerCase()].defaultEncoding;
const artType = SUPPORTED_ART_TYPES[ext.toLowerCase()];
return artType ? artType.defaultEncoding : 'utf8';
}
function defaultEofFromExtension(ext) {
return SUPPORTED_ART_TYPES[ext.toLowerCase()].eof;
const artType = SUPPORTED_ART_TYPES[ext.toLowerCase()];
if(artType) {
return artType.eof;
}
}
// :TODO: Implement the following