server: fix blob download when receiving a 200 response (#6656)

This commit is contained in:
Tobias Heinze 2024-09-05 19:48:26 +02:00 committed by GitHub
parent f27c00d8c5
commit 6fc9d22707
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -256,7 +256,7 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *regis
continue continue
} }
defer resp.Body.Close() defer resp.Body.Close()
if resp.StatusCode != http.StatusTemporaryRedirect { if resp.StatusCode != http.StatusTemporaryRedirect && resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("unexpected status code %d", resp.StatusCode) return nil, fmt.Errorf("unexpected status code %d", resp.StatusCode)
} }
return resp.Location() return resp.Location()