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

3 ➡️ 4 #72

Merged
merged 9 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

### Ignition Fuel Tools 3.x.x (20xx-xx-xx)

### Ignition Fuel Tools 3.2.2 (2020-05-18)

1. Fix URL encodings in RestClient.
* [Pull request 70](https://github.com/ignitionrobotics/ign-fuel-tools/pull/70)

1. Print message when downloading a resource.
* [BitBucket pull request 102](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-fuel-tools/pull-requests/102)

Expand Down
10 changes: 9 additions & 1 deletion src/RestClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,15 @@ RestResponse Rest::Request(HttpMethod _method,
std::string url = RestJoinUrl(_url, _version);

CURL *curl = curl_easy_init();
char *encodedPath = curl_easy_escape(curl, _path.c_str(), _path.size());

// First, unescape the _path since it might have %XX encodings. If this
// step is not performed, then curl_easy_escape will encode the %XX
// encodings resulting in an incorrect URL.
int decodedSize;
char *decodedPath = curl_easy_unescape(curl,
_path.c_str(), _path.size(), &decodedSize);

char *encodedPath = curl_easy_escape(curl, decodedPath, decodedSize);
url = RestJoinUrl(url, encodedPath);

// Process query strings.
Expand Down