Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ios formdata boundary include slash
Summary: some server not work when upload a file with FromData in ios. the reason is that there is a slash in boundary, like: ``` multipart/form-data; boundary=b/QeEbFgqK9PCZo4T/eXv7f.T74SHd5MxCZ846AsTz-yNV0xrRR_Zks4fkNMCzJck9ZE8o // koa request.js (line 548) is(types) { if (!types) return typeis(this.req); if (!Array.isArray(types)) types = [].slice.call(arguments); return typeis(this.req, types); } // type-is index.js (line 237) function normalizeType (value) { // parse the type var type = typer.parse(value) // remove the parameters type.parameters = undefined // reformat it return typer.format(type) } // media-typer var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g; ``` thanks for dougwilson 's [answer](jshttp/media-typer#5). > The / is an illegal character for Content-Type, which is what this module parses Closes facebook#11342 Differential Revision: D4326750 Pulled By: javache fbshipit-source-id: b1c78a335c95a5c223537545d87beaffe15d673d
- Loading branch information