misc fixes
This commit is contained in:
@@ -41,7 +41,8 @@ class WTVMime {
|
|||||||
if (this.minisrv_config.config.enable_gzip_compression || this.minisrv_config.config.force_compression_type) {
|
if (this.minisrv_config.config.enable_gzip_compression || this.minisrv_config.config.force_compression_type) {
|
||||||
var is_bf0app = ssid_session.get("wtv-client-rom-type") == "bf0app";
|
var is_bf0app = ssid_session.get("wtv-client-rom-type") == "bf0app";
|
||||||
var isOldBuild = this.wtvshared.isOldBuild(ssid_session);
|
var isOldBuild = this.wtvshared.isOldBuild(ssid_session);
|
||||||
var is_softmodem = ssid_session.get("wtv-client-rom-type").match(/softmodem/);
|
var is_softmodem = false;
|
||||||
|
if (ssid_session.get("wtv-client-rom-type")) is_softmodem = ssid_session.get("wtv-client-rom-type").match(/softmodem/);
|
||||||
if (!is_bf0app && ((!is_softmodem && !isOldBuild) || (is_softmodem && !isOldBuild))) {
|
if (!is_bf0app && ((!is_softmodem && !isOldBuild) || (is_softmodem && !isOldBuild))) {
|
||||||
// softmodem boxes do not appear to support gzip in the minibrowser
|
// softmodem boxes do not appear to support gzip in the minibrowser
|
||||||
// LC2 appears to support gzip even in the MiniBrowser
|
// LC2 appears to support gzip even in the MiniBrowser
|
||||||
@@ -75,9 +76,10 @@ class WTVMime {
|
|||||||
// gzip only
|
// gzip only
|
||||||
if (content_type.match(/^audio\/(x-)?(s3m|mod|xm)$/)) compress_data = true; // s3m, mod, xm
|
if (content_type.match(/^audio\/(x-)?(s3m|mod|xm)$/)) compress_data = true; // s3m, mod, xm
|
||||||
if (content_type.match(/^audio\/(x-)?(midi|wav|wave|aif(f)?)$/)) compress_data = true; // midi & wav
|
if (content_type.match(/^audio\/(x-)?(midi|wav|wave|aif(f)?)$/)) compress_data = true; // midi & wav
|
||||||
|
if (content_type.match(/^application\/karaoke$/)) compress_data = true; // midi karaoke
|
||||||
if (content_type.match(/^binary\/x-wtv-approm$/)) compress_data = true; // approms
|
if (content_type.match(/^binary\/x-wtv-approm$/)) compress_data = true; // approms
|
||||||
if (content_type.match(/^binary\/doom-data$/)) compress_data = true; // DOOM WADs
|
if (content_type.match(/^binary\/doom-data$/)) compress_data = true; // DOOM WADs
|
||||||
if (content_type.match(/^wtv\/download-list$/)) compress_data = true; // WebTV Download List
|
if (content_type.match(/^wtv\/download-list$/)) compress_data = true; // WebTV Download List
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,6 +181,9 @@ class WTVMime {
|
|||||||
case "wad":
|
case "wad":
|
||||||
wtv_mime_type = "binary/doom-data";
|
wtv_mime_type = "binary/doom-data";
|
||||||
break;
|
break;
|
||||||
|
case "kar":
|
||||||
|
wtv_mime_type = "application/karaoke";
|
||||||
|
break;
|
||||||
case "mp2":
|
case "mp2":
|
||||||
case "hsb":
|
case "hsb":
|
||||||
case "rmf":
|
case "rmf":
|
||||||
|
|||||||
@@ -106,12 +106,11 @@ async function processPath(socket, service_vault_file_path, request_headers = ne
|
|||||||
var headers, data = null;
|
var headers, data = null;
|
||||||
var request_is_async = false;
|
var request_is_async = false;
|
||||||
var service_vault_found = false;
|
var service_vault_found = false;
|
||||||
var service_path = service_vault_file_path;
|
var service_path = unescape(service_vault_file_path);
|
||||||
try {
|
try {
|
||||||
service_vaults.forEach(function (service_vault_dir) {
|
service_vaults.forEach(function (service_vault_dir) {
|
||||||
if (service_vault_found) return;
|
if (service_vault_found) return;
|
||||||
service_vault_file_path = wtvshared.makeSafePath(service_vault_dir, service_path);
|
service_vault_file_path = wtvshared.makeSafePath(service_vault_dir, service_path);
|
||||||
console.log(service_vault_file_path);
|
|
||||||
// deny access to catchall file name directly
|
// deny access to catchall file name directly
|
||||||
var service_path_split = service_path.split("/");
|
var service_path_split = service_path.split("/");
|
||||||
var service_path_request_file = service_path_split[service_path_split.length - 1];
|
var service_path_request_file = service_path_split[service_path_split.length - 1];
|
||||||
|
|||||||
Reference in New Issue
Block a user