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(apigateway): support dynamic routes with equal sign (RFC3986) #1737

Merged
merged 2 commits into from
Nov 21, 2022

Conversation

heitorlessa
Copy link
Contributor

Issue number: #1736

Summary

Changes

Please provide a summary of what's being changed

This PR adds the previously missed reserved equal sign (=) as safe chars as part of RFC3986. It allows customers defining dynamic routes with a = to be matched as expected.

User experience

Please share what the user experience looks like before and after this change

from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools.utilities.typing import LambdaContext

app = APIGatewayRestResolver()

# NOTE: `/token/bXl0b2tlbg==` should be matched and not return 404 now
@app.get("/token/<token>")
def get_token(token: str):
    return {"received": f"{token}"}


def lambda_handler(event: dict, context: LambdaContext) -> dict:
    return app.resolve(event, context)

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

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

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@heitorlessa heitorlessa requested a review from a team as a code owner November 21, 2022 10:21
@heitorlessa heitorlessa requested review from rubenfonseca and removed request for a team November 21, 2022 10:21
@boring-cyborg boring-cyborg bot added the tests label Nov 21, 2022
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 21, 2022
@github-actions github-actions bot added the bug Something isn't working label Nov 21, 2022
@heitorlessa heitorlessa merged commit cb2eb96 into aws-powertools:develop Nov 21, 2022
@heitorlessa heitorlessa deleted the fix/apigw-equal-sign branch November 21, 2022 10:30
@heitorlessa heitorlessa linked an issue Nov 21, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working event_handlers size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: equal sign in path breaks lambda dynamic URL paths
2 participants