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

FormData's append method does not match browsers #73

Closed
domenic opened this issue Jun 26, 2016 · 1 comment
Closed

FormData's append method does not match browsers #73

domenic opened this issue Jun 26, 2016 · 1 comment

Comments

@domenic
Copy link
Member

domenic commented Jun 26, 2016

https://xhr.spec.whatwg.org/#interface-formdata

The append(name, value, filename) method, when invoked, must run these steps:​

See discussion in jsdom/jsdom#1533

Given this code:

var formData = new FormData();
var file = new Blob([
   JSON.stringify({})
], { type: 'application/json' });
formData.append('somename', file);
formData.entries().next().value

My reading is that per the spec this should append a new entry whose name is "somename" and whose value is a Blob to the form data. Then, entries().next().value should return the Blob right back.

However, apparently in Chrome and Firefox it does not do that. Instead it converts it to a File (not a Blob) with, at least in Chrome, name "blob".

@annevk
Copy link
Member

annevk commented Jun 27, 2016

Thanks for filing. I need to revert the remainder of f9d4c25. I thought someone would file an issue on that but I guess that didn't happen.

@annevk annevk closed this as completed in 1a75845 Jun 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants