mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
Cope with zero-length http downloads
This commit is contained in:
committed by
Benj Fassbind
parent
a687df2f4f
commit
4b2efeec7a
@@ -111,6 +111,10 @@ func (downloader *downloaderImpl) GetLength(ctx context.Context, url string) (in
|
||||
}
|
||||
|
||||
if resp.ContentLength < 0 {
|
||||
// an existing, but zero-length file can be reported with ContentLength -1
|
||||
if resp.StatusCode == 200 && resp.ContentLength == -1 {
|
||||
return 0, nil
|
||||
}
|
||||
return -1, fmt.Errorf("could not determine length of %s", url)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user