models/load: ensure request body is closed

Signed-off-by: Dorin Geman <dorin.geman@docker.com>
This commit is contained in:
Dorin Geman 2025-07-24 12:27:25 +03:00
parent 4215c129be
commit db19d8318f
No known key found for this signature in database
1 changed files with 2 additions and 0 deletions

View File

@ -196,6 +196,8 @@ func (m *Manager) handleLoadModel(w http.ResponseWriter, r *http.Request) {
return
}
defer r.Body.Close()
if _, err := m.distributionClient.LoadModel(r.Body, w); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return