"docs/1_exist_data_model.md" did not exist on "5d9682a27c4581d5724401873a62fa3019b53f4b"
Commit 04733438 authored by Michael Yang's avatar Michael Yang
Browse files

check head request response

parent 711e891f
......@@ -78,6 +78,11 @@ func (b *blobDownload) Prepare(ctx context.Context, requestURL *url.URL, opts *R
}
defer resp.Body.Close()
if resp.StatusCode >= http.StatusBadRequest {
body, _ := io.ReadAll(resp.Body)
return fmt.Errorf("registry responded with code %d: %v", resp.StatusCode, string(body))
}
b.Total, _ = strconv.ParseInt(resp.Header.Get("Content-Length"), 10, 64)
var offset int64
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment