• Michael Yang's avatar
    fix superfluous call to WriteHeader · 214a7678
    Michael Yang authored
    the first call to http.ResponseWriter.Write implicitly calls WriteHeader
    with http.StatusOK if it hasn't already been called. once WriteHeader
    has been called, subsequent calls has no effect. Write is called when
    JSON encoding progressUpdateJSON{}. calls to
    http.ResponseWriter.WriteHeader after the first encode is useless and
    produces a warning:
    
    http: superfluous response.WriteHeader call from github.com/ollama/ollama/server/internal/registry.(*statusCodeRecorder).WriteHeader (server.go:77)
    214a7678
server.go 10.9 KB