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

fix get_raw_path with double slash prefix path for legacy v-host S3 #9725

Merged
merged 2 commits into from Nov 24, 2023

Conversation

bentsku
Copy link
Contributor

@bentsku bentsku commented Nov 24, 2023

Motivation

As raised by #9723, when supplying a path only starting with double slashes, get_raw_path does not parse it properly, it returns an empty .path property.
If RAW_URI contains only a path, get_raw_path does need to call urlparse, we can manually strip the query string and return the path from it.

Changes

  • manually return the path from RAW_URI if it starts with a double slashes
  • add S3 tests in virtual host mode which validates the fix for the legacy provider (calling get_raw_path when rewriting the URL)
  • add a unit test

@bentsku bentsku added aws:s3 Amazon Simple Storage Service area: asf semver: patch Non-breaking changes which can be included in patch releases labels Nov 24, 2023
@bentsku bentsku self-assigned this Nov 24, 2023
Copy link

github-actions bot commented Nov 24, 2023

LocalStack Community integration with Pro

       2 files         2 suites   1h 8m 1s ⏱️
2 358 tests 2 043 ✔️ 315 💤 0
2 359 runs  2 043 ✔️ 316 💤 0

Results for commit 19bbd5c.

♻️ This comment has been updated with latest results.

@coveralls
Copy link

coveralls commented Nov 24, 2023

Coverage Status

coverage: 84.002% (-0.04%) from 84.04%
when pulling 19bbd5c on fix-double-slash-prefix-path
into 1399fda on master.

Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Clean fix, with great tests 👍🏽 💯

@bentsku bentsku merged commit f023ab9 into master Nov 24, 2023
28 checks passed
@bentsku bentsku deleted the fix-double-slash-prefix-path branch November 24, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: asf aws:s3 Amazon Simple Storage Service semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants