mirror of
https://github.com/ollama/ollama
synced 2026-04-23 08:45:14 +00:00
Merge c4f15629b4 into 160660e572
This commit is contained in:
commit
46f2de287d
|
|
@ -262,10 +262,14 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *regis
|
|||
continue
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusTemporaryRedirect && resp.StatusCode != http.StatusOK {
|
||||
switch resp.StatusCode {
|
||||
case http.StatusTemporaryRedirect:
|
||||
return resp.Location()
|
||||
case http.StatusOK:
|
||||
return resp.Request.URL, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unexpected status code %d", resp.StatusCode)
|
||||
}
|
||||
return resp.Location()
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue