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

Content-Type Issue #29

Closed
rpavez opened this Issue Oct 29, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@rpavez

rpavez commented Oct 29, 2013

I'm working with file uploads from Titanium. I spend a lot of type trying to find out the solution for the error:

unrecognized content-type:multipart/form-data; charset=utf-8; boundary=0xKhTmLbOuNdArY-019828C5-31F2-414B-9FC0-F68B537DD62D

Reading the source file I discover the match in line 104 uses CONTENT_TYPE_RE
which is set to
var CONTENT_TYPE_RE = /^multipart/(form-data|related);\s+boundary=(?:"([^"]+)"|([^;]+))$/i;

I found the solution for this error was as simple as changing this variable to :
var CONTENT_TYPE_RE = /^multipart/(form-data|related);\s+charset=utf-8;\s+boundary=(?:"([^"]+)"|([^;]+))$/i;

Not sure if this is an issue caused by a non-standard header from Titanium but I suspect its something this lib should add.

@andrewrk

This comment has been minimized.

Show comment
Hide comment
@andrewrk

andrewrk Nov 11, 2013

Collaborator

I believe this is a duplicate of #31 (or vice versa) and is now fixed.

Collaborator

andrewrk commented Nov 11, 2013

I believe this is a duplicate of #31 (or vice versa) and is now fixed.

@andrewrk andrewrk closed this Nov 11, 2013

@godfroidt

This comment has been minimized.

Show comment
Hide comment
@godfroidt

godfroidt Feb 20, 2014

Sorry to comment on a closed issue, but I do not see why you say that it's handled from content-type when the fix for #31 applies only to content-disposition.

I had the exact same issue yesterday (on 2.2.0 admittedly) and solved it just as described above . I looked at the pull request for #31 and fails so see how upgrading to get this will help me. (I also checked the regex in HEAD and it still see the supposed issue).

Am I missing something ?
Thanks

godfroidt commented Feb 20, 2014

Sorry to comment on a closed issue, but I do not see why you say that it's handled from content-type when the fix for #31 applies only to content-disposition.

I had the exact same issue yesterday (on 2.2.0 admittedly) and solved it just as described above . I looked at the pull request for #31 and fails so see how upgrading to get this will help me. (I also checked the regex in HEAD and it still see the supposed issue).

Am I missing something ?
Thanks

@andrewrk andrewrk reopened this Feb 20, 2014

@andrewrk

This comment has been minimized.

Show comment
Hide comment
@andrewrk

andrewrk Feb 20, 2014

Collaborator

Can you provide an example payload that demonstrates the problem?

Collaborator

andrewrk commented Feb 20, 2014

Can you provide an example payload that demonstrates the problem?

@godfroidt

This comment has been minimized.

Show comment
Hide comment
@godfroidt

godfroidt Feb 20, 2014

Hi Andrew, the one in the original issue is essentially the same but here is a capture from 5 minutes ago:
Content-Type: multipart/form-data; charset=utf-8; boundary=0xKhTmLbOuNdArY-33412DD4-95E7-4412-A6AA-F4EAA05E08F9

It blows up on charset as explained. The regexp in the original issue solved it but I don't remember from the HTTP standard whether the parameters would always be in the same order.

godfroidt commented Feb 20, 2014

Hi Andrew, the one in the original issue is essentially the same but here is a capture from 5 minutes ago:
Content-Type: multipart/form-data; charset=utf-8; boundary=0xKhTmLbOuNdArY-33412DD4-95E7-4412-A6AA-F4EAA05E08F9

It blows up on charset as explained. The regexp in the original issue solved it but I don't remember from the HTTP standard whether the parameters would always be in the same order.

@godfroidt

This comment has been minimized.

Show comment
Hide comment
@godfroidt

godfroidt Feb 20, 2014

looks good. Thanks.

godfroidt commented Feb 20, 2014

looks good. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment