summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/images_save.go
blob: b39c719a0cfe71828defd2e68b528bfd3130e1bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package compat

import (
	"io"
	"net/http"
	"os"
)

func SaveFromBody(f *os.File, r *http.Request) error { // nolint
	if _, err := io.Copy(f, r.Body); err != nil {
		return err
	}
	return f.Close()
}