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

Custom encoding method #22

Closed
FabienChaynes opened this issue May 29, 2018 · 5 comments
Closed

Custom encoding method #22

FabienChaynes opened this issue May 29, 2018 · 5 comments
Assignees

Comments

@FabienChaynes
Copy link
Contributor

Hi,

I encountered an incompatibility issue in the Twitter gem between http-form_data and simple_oauth. More explanation are given in this issue.

Basically here (http-form_data) and there (simple_oauth) the encoding is not done the same way.
http-form_data uses URI.encode_www_form which uses URI.encode_www_form_component which doesn't convert *, while simple_oauth encodes *. The twitter API requires * to be encoded as explained in this post.

I understand that it's not a bug in http-form_data per se, but would you be OK to merge a PR allowing users of the gem to override the method encoding data in HTTP::FormData::Urlencoded#initialize and provide their own? By default it'd obviously still be ::URI.encode_www_form so it'd be a transparent change.
If it sounds somewhat acceptable to you, I'd be glad to work on something and to submit a PR.

Thanks 🙂

@ixti
Copy link
Member

ixti commented May 29, 2018

I'm OK with this. Please open a PR so we can start a discussion on API changes :D

@FabienChaynes
Copy link
Contributor Author

Neat!
Will do 👍

@clarkbab
Copy link

clarkbab commented Jun 1, 2018

Hi @ixti, any chance of patching the version with this addition?

@ixti
Copy link
Member

ixti commented Jun 1, 2018

@clarkbab Sure. Will do shortly

@ixti
Copy link
Member

ixti commented Jun 1, 2018

Released as v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants