Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pulimsr
Copy link
Contributor

@pulimsr pulimsr commented Nov 10, 2025

Issue #3618

Description of changes: Fixed trailing slash preservation logic in URI parsing to correctly handle both S3 object keys with trailing slashes and SNS signature compatibility when s_
preservePathSeparators is enabled.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.


auto putObjectRequest = PutObjectRequest()
.WithBucket("velvetunderground")
.WithKey("////stephanie////says////////////that////////she//wants///////to/know.txt");
Copy link
Contributor

Choose a reason for hiding this comment

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

i dont think we want to remove this test case. Its still a valuable test case, i think we just want to add more test cases. additionally can you add a test case for .txt// to make sure that it works for many slashes and not just one

}

if (m_pathSegments.empty() || m_pathHasTrailingSlash)
if (m_pathSegments.empty())
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you change this?

if (m_pathSegments.empty() || m_pathHasTrailingSlash)
{
  path.push_back('/');
}

it is functionally the same as

if (m_pathSegments.empty())
{
  path.push_back('/');
}
else if (m_pathHasTrailingSlash)
{
  path.push_back('/');
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right - this was a mistake while trying to change the code back. Updating now.

@pulimsr pulimsr merged commit b915d3b into main Nov 12, 2025
4 of 5 checks passed
@pulimsr pulimsr deleted the path-saparator branch November 12, 2025 16:07
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.

2 participants