Skip to content

Throw exception on passing MultipartFormDataContent in AddPinataFile #1

Open
@GorgeousPuree

Description

@GorgeousPuree

Context

Hi, thanks for your Pinata client first of all.
I needed to upload a directory with files. In PinFileToIpfsAsync I've passed Action in which I've called AddPinataFile only once and passed MultipartFormDataContent object in it. Since MultipartFormDataContent is a heir of HttpContent code worked correctly, but when I opened Pinata I saw, that I've uploaded a file without extension.
I was puzzled until I opened your source code and after that I've replaced one call of AddPinataFile passing MultipartFormDataContent with foreach and passing ByteArrayContent.
It is not intended to use MultipartFormDataContent in AddPinataFile, so maybe it should be prevented?

image

Alternatives

Throw ArgumentException when user passes MultipartFormDataContent object in AddPinataFile.

If the feature request is approved, would you be willing to submit a PR?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions