Skip to content

Commit 572a3ad

Browse files
committed
parseInt Content-Length
1 parent 9a414a2 commit 572a3ad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

logtail.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ function get_log() {
5858
throw "Server did not respond with a Content-Range";
5959

6060
log_file_size = parseInt(c_r.split("/")[1]);
61-
content_size = xhr.getResponseHeader("Content-Length");
61+
content_size = parseInt(xhr.getResponseHeader("Content-Length"));
6262
} else if (xhr.status === 200) {
6363
if (must_get_206)
6464
throw "Expected 206 Partial Content";
6565

66-
content_size = log_file_size = xhr.getResponseHeader("Content-Length");
66+
content_size = log_file_size =
67+
parseInt(xhr.getResponseHeader("Content-Length"));
6768
} else {
6869
throw "Unexpected status " + xhr.status;
6970
}

0 commit comments

Comments
 (0)