-
Notifications
You must be signed in to change notification settings - Fork 19
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
bugfix(ZENKO-1362): request path encoding #631
Conversation
Hello giacomoguiulfo,My role is to assist you with the merge of this Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
@bert-e approve |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: The following options are set: approve |
lib/network/rest/RESTServer.js
Outdated
@@ -51,7 +51,7 @@ function sendError(res, log, error, optMessage) { | |||
*/ | |||
function parseURL(urlStr, expectKey) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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`, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
507b959
to
52ec11f
Compare
52ec11f
to
d6fdd15
Compare
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
The following branches will NOT be impacted:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue ZENKO-1362. Goodbye giacomoguiulfo. |
This PR will make the
RESTClient
encode the path of its requests and allow theRESTServer
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.