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

Do not trim leading slashes for copy object and copy part operations #3532

Merged

Conversation

peterrsongg
Copy link
Contributor

@peterrsongg peterrsongg commented Oct 30, 2024

…perations

Description

The .NET SDK trims leading slashes on copy object and copy part operations. This behavior can be turned off by setting DisableTrimmingLeadingSlash to true. This change removes that flag so that the .NET SDK will not trim leading slashes.

Motivation and Context

This is something we can only fix in v4

Testing

dry run in v4 passes.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

[DataRow(false, testKey, "/destinationTestKey1.txt", "destinationTestKey1.txt")]
[DataRow(true, testKeyWithSlash, "/destinationTestKey2.txt", "/destinationTestKey2.txt")]
[DataRow(true, testKeyWithSlash, "/", "/")]
[DataRow(testKey, "/destinationTestKey1.txt", "/destinationTestKey1.txt")]
Copy link
Member

Choose a reason for hiding this comment

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

nit: I think it is better to remove the slash from the destinationKey instead of adding it to the expectedKey to make this test case different than the second one, or remove the slashes from the next test case.

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this test could be even better if the data row was:

[DataRow(testKeyWithSlash, "destinationTestKey1.txt", "destinationTestKey1.txt")]

There's already another test case in this class copying testKey somewhere else. The code above will validate the leading slash is handled properly.

@peterrsongg peterrsongg merged commit e34641f into v4-development Oct 31, 2024
1 check passed
@peterrsongg peterrsongg deleted the petesong/remove-disable-trimming-leading-slash branch October 31, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants