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

Escape path variables #354

Merged
merged 2 commits into from
Jul 22, 2015
Merged

Conversation

marshall-lee
Copy link
Contributor

When dealing with parameters in a query string (?a=1&b=blabla) Faraday escapes keys and values using Faraday::Utils.escape helper. But when parameters are passed in a path string (RESTful way) it doesn't happen so for example when id value is something non-ascii.
Since http path building is done on the Her side, it should be fixed here.

@marshall-lee
Copy link
Contributor Author

This breaks our api clients on some ids 😭

@hubert
Copy link
Contributor

hubert commented Jul 21, 2015

thanks for the contribution. couple questions:

  1. should we be escaping the primary key value as well?

  2. could you update the test so that it is testing the public interface for path building (request_path) vs the underlying class method?

@marshall-lee
Copy link
Contributor Author

@hubert it escapes primary key as you may see in the new added spec.

@marshall-lee
Copy link
Contributor Author

@hubert wait, you mean rewrite all the tests to use request_path ?

@marshall-lee
Copy link
Contributor Author

updated

@hubert
Copy link
Contributor

hubert commented Jul 22, 2015

Haha. I actually just meant the new specs but it's great that you did them all :-)

I'll take a look at this when I get home.

hubert added a commit that referenced this pull request Jul 22, 2015
@hubert hubert merged commit ec97bad into remi:master Jul 22, 2015
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

Successfully merging this pull request may close these issues.

2 participants