File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ function get_log() {
44
44
loading = false ;
45
45
46
46
var size ;
47
+ var content_size ;
47
48
48
49
if ( xhr . status === 206 ) {
49
50
if ( data . length > load )
@@ -54,20 +55,23 @@ function get_log() {
54
55
throw "Server did not respond with a Content-Range" ;
55
56
56
57
size = parseInt ( c_r . split ( "/" ) [ 1 ] ) ;
58
+ content_size = xhr . getResponseHeader ( "Content-Length" ) ;
59
+
57
60
if ( isNaN ( size ) )
58
61
throw "Invalid Content-Range size" ;
59
62
} else if ( xhr . status === 200 ) {
60
63
if ( log_size > 1 )
61
64
throw "Expected 206 Partial Content" ;
62
65
63
- size = data . length ;
66
+ size = xhr . getResponseHeader ( "Content-Length" ) ;
67
+ content_size = size ;
64
68
}
65
69
66
70
var added = false ;
67
71
68
72
if ( log_size === 0 ) {
69
73
/* Clip leading part-line if not the whole file */
70
- if ( data . length < size ) {
74
+ if ( content_size < size ) {
71
75
var start = data . indexOf ( "\n" ) ;
72
76
log_data = data . substring ( start + 1 ) ;
73
77
} else {
You can’t perform that action at this time.
0 commit comments