add protection against requesting direct service files

This commit is contained in:
zefie
2021-08-15 18:51:48 -04:00
parent daf6ec9339
commit 1967c076a9
48 changed files with 215 additions and 52 deletions

View File

@@ -1,3 +1,5 @@
var minisrv_service_file = true;
const WTVFlashrom = require("./WTVFlashrom.js");
request_is_async = true;

View File

@@ -1,3 +1,5 @@
var minisrv_service_file = true;
const WTVFlashrom = require("./WTVFlashrom.js");
request_is_async = true;

View File

@@ -1,3 +1,5 @@
var minisrv_service_file = true;
const WTVFlashrom = require("./WTVFlashrom.js");
request_is_async = true;

View File

@@ -93,7 +93,9 @@ data += `
nexturl="${flashrom_info.next_rompath}"
errorurl="${service_name}:/lc2-download-failed?"
`
if (!flashrom_info.is_last_part) data += `blockurl = "${flashrom_info.rompath}"`;
if (!var minisrv_service_file = true;
flashrom_info.is_last_part) data += `blockurl = "${flashrom_info.rompath}"`;
data += `
lastblock="${flashrom_info.is_last_part}"

View File

@@ -1,3 +1,5 @@
var minisrv_service_file = true;
if (request_headers.query.path) {
var url = service_name + ":/get-lc2-page?path=" + request_headers.query.path;
var romtype = ssid_sessions[socket.ssid].get("wtv-client-rom-type");

View File

@@ -42,7 +42,9 @@ Updating complete
<td colspan=12 width=560 height=10 valign=top align=left>
<img src="${service_name}:/ROMCache/S40H1.gif" width=560 height=6>
<tr>
<td width=104 height=10 valign=top align=left>
<td width=104 height=10 valign=top align=left>var minisrv_service_file = true;
<td width=20 valign=top align=left>
<td width=67 valign=top align=left>
<td width=20 valign=top align=left>

View File

@@ -1,3 +1,5 @@
var minisrv_service_file = true;
var error = '';
if (request_headers.query.error) {
switch (request_headers.query.error) {

View File

@@ -1,3 +1,5 @@
var minisrv_service_file = true;
const WTVFlashrom = require("./WTVFlashrom.js");
request_is_async = true;

View File

@@ -1,3 +1,5 @@
var minisrv_service_file = true;
// willie is just a graphical frontend to a list of ROMs
// the rest of the scripts should work if you manually link to a ROM, and actually have it.