Skip to content

Commit ec2e7d9

Browse files
committed
Fix type handling for content-length header in responseBytes
1 parent 1b4fc25 commit ec2e7d9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/devtools_app/lib/src/shared/http/http_request_data.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,14 @@ class DartIOHttpRequestData extends NetworkRequest {
236236
return int.tryParse(contentLength);
237237
}
238238
if (contentLength is List && contentLength.isNotEmpty) {
239-
return int.tryParse(contentLength.first);
239+
final first = contentLength.first;
240+
241+
if (first is int) {
242+
return first;
243+
}
244+
if (first is String) {
245+
return int.tryParse(first);
246+
}
240247
}
241248
return null;
242249
}

0 commit comments

Comments
 (0)