[#148] Add custom multipart reader

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-04-29 18:25:26 +03:00 committed by Alex Vanin
parent 8ced5f40e8
commit 562c7e994c
3 changed files with 586 additions and 1 deletions

View file

@ -2,8 +2,8 @@ package uploader
import (
"io"
"mime/multipart"
"github.com/nspcc-dev/neofs-http-gw/uploader/multipart"
"go.uber.org/zap"
)
@ -15,6 +15,8 @@ type MultipartFile interface {
}
func fetchMultipartFile(l *zap.Logger, r io.Reader, boundary string) (MultipartFile, error) {
// To have a custom buffer (3mb) the custom multipart reader is used.
// https://github.com/nspcc-dev/neofs-http-gw/issues/148
reader := multipart.NewReader(r, boundary)
for {