mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2026-02-06 11:17:36 +00:00
Validate Content-Length header before parsing in EJS_Download class
This commit is contained in:
parent
d9909fea89
commit
3d824853af
@ -113,7 +113,10 @@ class EJS_Download {
|
||||
let contentLength = 0;
|
||||
if (resp.headers.get("Content-Length")) {
|
||||
try {
|
||||
contentLength = parseInt(resp.headers.get("Content-Length"));
|
||||
const parsedContentLength = parseInt(resp.headers.get("Content-Length"));
|
||||
if (!isNaN(parsedContentLength) && parsedContentLength > 0) {
|
||||
contentLength = parsedContentLength;
|
||||
}
|
||||
} catch (e) {
|
||||
// swallow any errors parseing content length
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user