jimmywarting / FormData

HTML5 `FormData` polyfill for Browsers and nodejs
MIT License
360 stars 102 forks source link

[Suggestion] Add more per-entry headers #116

Closed jimmywarting closed 2 years ago

jimmywarting commented 3 years ago

This is not in the specification but i can see a value by adding a Content-Length header before every entry so it would look something like this

------WebKitFormBoundaryI2aNXnjBifHTBeH1
Content-Disposition: form-data; name="x"; filename="dummy.txt"
Content-Type: text/plain
Content-Length: 3

abc
------WebKitFormBoundaryI2aNXnjBifHTBeH1--

(fyi this has nothing to do with request headers - only form-data entries headers in the body)

This could easily be added without any code changes on developers parts.

Last-Modified header could also be inherited/included from a File instance with the lastModified property.

I bet no decoders would even use, care or break anything if they saw this two extra entry headers.

I have already written to whatwg on github and suggested that this two extra per-entry headers gets added - if you want to get some more background context.

I think i could add them into this library without breaking anything. ...Would like to hear what someone else have to say about this. Should i include them?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.