Browse Source
Merge pull request #5999 from ollama/mxyng/fix-push
fix nil deref in auth.go
royh/stream-tools
Michael Yang
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
2 additions and
2 deletions
-
server/auth.go
-
server/upload.go
|
|
|
@ -67,7 +67,7 @@ func getAuthorizationToken(ctx context.Context, challenge registryChallenge) (st |
|
|
|
|
|
|
|
headers.Add("Authorization", signature) |
|
|
|
|
|
|
|
response, err := makeRequest(ctx, http.MethodGet, redirectURL, headers, nil, nil) |
|
|
|
response, err := makeRequest(ctx, http.MethodGet, redirectURL, headers, nil, ®istryOptions{}) |
|
|
|
if err != nil { |
|
|
|
return "", err |
|
|
|
} |
|
|
|
|
|
|
|
@ -254,7 +254,7 @@ func (b *blobUpload) uploadPart(ctx context.Context, method string, requestURL * |
|
|
|
|
|
|
|
// retry uploading to the redirect URL
|
|
|
|
for try := range maxRetries { |
|
|
|
err = b.uploadPart(ctx, http.MethodPut, redirectURL, part, nil) |
|
|
|
err = b.uploadPart(ctx, http.MethodPut, redirectURL, part, ®istryOptions{}) |
|
|
|
switch { |
|
|
|
case errors.Is(err, context.Canceled): |
|
|
|
return err |
|
|
|
|