aboutsummaryrefslogtreecommitdiff
path: root/src/js/builtins/EventSource.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/builtins/EventSource.ts')
-rw-r--r--src/js/builtins/EventSource.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/js/builtins/EventSource.ts b/src/js/builtins/EventSource.ts
index 64179bc0d..a26c8d4ce 100644
--- a/src/js/builtins/EventSource.ts
+++ b/src/js/builtins/EventSource.ts
@@ -135,7 +135,7 @@ export function getEventSource() {
id = line.substring(3).trim();
} else if (line.startsWith("retry:")) {
retry = parseInt(line.substring(6).trim(), 10);
- if (isNaN(retry)) {
+ if (retry !== retry) {
retry = -1;
}
}
@@ -278,7 +278,7 @@ export function getEventSource() {
header_name.localeCompare("content-length", undefined, { sensitivity: "accent" }) === 0;
if (is_content_length) {
content_length = parseInt(header.substring(header_name_idx + 1).trim(), 10);
- if (isNaN(content_length) || content_length <= 0) {
+ if (content_length !== content_length || content_length <= 0) {
self.dispatchEvent(
new ErrorEvent("error", {
error: new Error(`EventSource's Content-Length is invalid. Aborting the connection.`),