"tests/vscode:/vscode.git/clone" did not exist on "f21b5ffc4dcea2acb9d62326b4922ef756597d83"
Unverified Commit ccc3e9ac authored by Michael Yang's avatar Michael Yang Committed by GitHub
Browse files

Merge pull request #531 from jmorganca/mxyng/content-length

set request.ContentLength
parents 3ee85f1c daa4f096
......@@ -1442,6 +1442,15 @@ func makeRequest(ctx context.Context, method string, requestURL *url.URL, header
req.Header.Set("User-Agent", fmt.Sprintf("ollama/%s (%s %s) Go/%s", version.Version, runtime.GOARCH, runtime.GOOS, runtime.Version()))
if s := req.Header.Get("Content-Length"); s != "" {
contentLength, err := strconv.ParseInt(s, 10, 64)
if err != nil {
return nil, err
}
req.ContentLength = contentLength
}
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
if len(via) >= 10 {
......
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