Skip to content

Custom encoding method #22

Description

@FabienChaynes

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 🙂

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions