Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in 7.1.1: adding request.field() fails if value is not Blob #1680

Closed
schnuet opened this issue Jan 27, 2022 · 6 comments · May be fixed by NOUIY/specberus#282 or openziti/ziti-browzer-edge-client#58

Comments

@schnuet
Copy link

schnuet commented Jan 27, 2022

Trying to add a field to a request (request.field('keyname', 'fielddata');) fails in 7.1.1 on Google Chrome and generates the following error:

failed to execute 'append' on 'formdata': parameter 2 is not of type 'blob'.

Culprit seems to be this line:
https://github.com/visionmedia/superagent/blob/84206c75214e20bbc688d0645880696ecd773c27/src/request-base.js#L463

Calling FormData.append(name, value, options); does not seem to work if value is not a Blob and options is undefined. The options parameter has to be omitted.

@scoumbourdis
Copy link

I had the same issue and I've downgraded to 7.0.2 as a work-around for now

@niftylettuce
Copy link
Collaborator

Can we get a PR to fix this?

@lucas-mancini
Copy link

I still can experience the same bug in latest version, v7.1.1. Is there a workaround or a fix planned?

@tkubicek3
Copy link

Any news?

@ltxhhz
Copy link
Contributor

ltxhhz commented May 29, 2022

@niftylettuce Hi, I've fixed the bug and hope to merge branches soon, thank you!🎉

titanism added a commit that referenced this issue May 31, 2022
fix: adding request.field() fails if value is not Blob (#1680)
@titanism
Copy link
Collaborator

Released in v7.1.4 to npm, thank you @ltxhhz

https://github.com/visionmedia/superagent/releases/tag/v7.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants