-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
fix ios formdata boundary include slash #11342
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
That will just break #7564 again. Can you instead change the dictionary where we generate the boundary from? |
|
remove slash from the dictionary of generate boundary |
@facebook-github-bot shipit |
I have the same issue. Currently https://golang.org/pkg/mime/#ParseMediaType returns error, because of "/". This is fixing the problem for me. |
Same problem, take me a few days to figure this out!!! Before update RN to 0.39, fetch works fine. |
@unordered Can you sign the CLA so I can pull this? |
@javache ok |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@javache has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Thanks, finally fixed this issue for me! |
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
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
some server not work when upload a file with FromData in ios.
the reason is that there is a slash in boundary, like:
thanks for @dougwilson 's answer.