storage/url: Allow usage of adjacent slashes#459
Merged
igungor merged 8 commits intopeak:masterfrom Jul 22, 2022
Merged
Conversation
This commit allows url with adjacent slashes to be handled correctly.
- Disabled RestProtocolURICleaning (link) as it do not allow adjacent slashes.
- Changed path.Join method to strings.Join when joined remote urls. path.Join also cleans paths which removes additional slashes.
- Kept local urls to be joined with path.Join.
- Added test cases for copy;
- Remote to local
- Local to remote
- Remote to remote
- Removed redundant trailing slashes in the keys of s3 objects in ls_test.go and sync_test.go files.
Fixes: peak#352 ,peak#449
Replaced strings.Cut method as it is undefined before go version 1.18.x
seruman
reviewed
Jul 18, 2022
igungor
approved these changes
Jul 21, 2022
igungor
requested changes
Jul 21, 2022
Member
igungor
left a comment
There was a problem hiding this comment.
@boraberke could you update the changelog file to reflect this change please? I'm not sure if this is a bugfix or an improvement :)
Contributor
Might even breaking for users who rely on URI cleaning 🙃 . |
Contributor
Author
Added three more entries to |
seruman
approved these changes
Jul 22, 2022
igungor
reviewed
Jul 22, 2022
igungor
approved these changes
Jul 22, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows url with adjacent slashes to be handled correctly.
Users should be careful while handling slashes in objectnames. Before this PR,
s5cmd cp /file.txt s3://bucket/would outputBut now it will result in double slashes as follows:
Fixes: #352
Fixes: #449