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

bugfix(ZENKO-1362): request path encoding #631

Merged
merged 3 commits into from
Dec 19, 2018

Conversation

giacomoguiulfo
Copy link
Contributor

This PR will make the RESTClient encode the path of its requests and allow the RESTServer to decode them.

With this change, PFSD will be able to read request properly when there are extraneous characters (like whitespaces) on the request's path, therefore allowing to read and delete files with such names.

@bert-e
Copy link
Contributor

bert-e commented Dec 18, 2018

Hello giacomoguiulfo,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get
information on this process.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Dec 18, 2018

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

Peer approvals must include at least 1 approval from the following list:

@giacomoguiulfo
Copy link
Contributor Author

@bert-e approve

@bert-e
Copy link
Contributor

bert-e commented Dec 18, 2018

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

Peer approvals must include at least 1 approval from the following list:

The following options are set: approve

@@ -51,7 +51,7 @@ function sendError(res, log, error, optMessage) {
*/
function parseURL(urlStr, expectKey) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have a couple unit tests for parseURL with special characters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathan-gramain I moved parseURL from RESTServer.js to utils.js and added a new tests file utils.js with tests.

expectedKey: 'test',
},
{
inputUrl: `${constants.passthroughFileURL}/test with spaces`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you want the spaces encoded as %20 or + here?

Copy link
Contributor Author

@giacomoguiulfo giacomoguiulfo Dec 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url.parse() (called in parseURL) already encodes the whitespaces for us (before decoding).
In other words, both encoding and decoding occur in parseURL. We could still provide already encoded URLs. I'll add it as an additional test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@giacomoguiulfo giacomoguiulfo force-pushed the bugfix/ZENKO-1362-request-path-encoding branch from 507b959 to 52ec11f Compare December 18, 2018 23:46
@bert-e
Copy link
Contributor

bert-e commented Dec 19, 2018

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/8.1

The following branches will NOT be impacted:

  • development/6.4
  • development/7.4
  • development/8.0

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Dec 19, 2018

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/8.1

The following branches have NOT changed:

  • development/6.4
  • development/7.4
  • development/8.0

Please check the status of the associated issue ZENKO-1362.

Goodbye giacomoguiulfo.

@bert-e bert-e merged commit d6fdd15 into development/8.1 Dec 19, 2018
@giacomoguiulfo giacomoguiulfo deleted the bugfix/ZENKO-1362-request-path-encoding branch December 19, 2018 18:56
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.

7 participants