diff --git a/api/handler/put_test.go b/api/handler/put_test.go index 4695900f7..dbe02e375 100644 --- a/api/handler/put_test.go +++ b/api/handler/put_test.go @@ -2,9 +2,12 @@ package handler import ( "encoding/json" + "mime/multipart" + "net/http" "testing" "time" + "github.com/nspcc-dev/neofs-s3-gw/api" "github.com/stretchr/testify/require" ) @@ -86,3 +89,18 @@ func TestCustomJSONMarshal(t *testing.T) { require.Equal(t, expectedPolicy, policy) } + +func TestEmptyPostPolicy(t *testing.T) { + r := &http.Request{ + MultipartForm: &multipart.Form{ + Value: map[string][]string{ + "key": {"some-key"}, + }, + }, + } + reqInfo := &api.ReqInfo{} + metadata := make(map[string]string) + + _, err := checkPostPolicy(r, reqInfo, metadata) + require.NoError(t, err) +}