Do not assume Content-Length header is always available

The Content-Length header cannot always be available, for example when
the transfer encoding is chunked.

Recently downloading the gzip'd pgo_training-1.ii has been failing
locally due to this.

Bug: 1324691
Change-Id: I37a1ae5c1ce4727b547d4da9544bb4d037d33835
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3646072
Reviewed-by: Hans Wennborg <hans@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Arthur Eubanks <aeubanks@google.com>
Cr-Commit-Position: refs/heads/main@{#1003356}
NOKEYCHECK=True
GitOrigin-RevId: 3501c0afd415c16d549bf4ebc5a1c4f5953a1a88
1 file changed