8000 add /_extension to well-known path prefixes to avoid s3 fallback handling by thrau · Pull Request #11796 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content
8000

add /_extension to well-known path prefixes to avoid s3 fallback handling #11796

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

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions localstack-core/localstack/aws/protocol/service_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ def custom_path_addressing_rules(path: str) -> Optional[ServiceModelIdentifier]:
return ServiceModelIdentifier("lambda")


well_known_path_prefixes = (
"/_aws",
"/_localstack",
"/_pods",
"/_extension",
)


def legacy_rules(request: Request) -> Optional[ServiceModelIdentifier]:
"""
*Legacy* rules which migrate routing logic which will become obsolete with the ASF Gateway.
Expand All @@ -192,8 +200,9 @@ def legacy_rules(request: Request) -> Optional[ServiceModelIdentifier]:

# TODO Remove once fallback to S3 is disabled (after S3 ASF and Cors rework)
# necessary for correct handling of cors for internal endpoints
if path.startswith("/_localstack") or path.startswith("/_pods") or path.startswith("/_aws"):
return None
for prefix in well_known_path_prefixes:
if path.startswith(prefix):
return None

# TODO The remaining rules here are special S3 rules - needs to be discussed how these should be handled.
# Some are similar to other rules and not that greedy, others are nearly general fallbacks.
Expand Down
Loading
0