Skip to content

don't append trailing '?' when query string is empty#657

Merged
bnusunny merged 1 commit intoaws:mainfrom
unoptimised:patch-1
Mar 12, 2026
Merged

don't append trailing '?' when query string is empty#657
bnusunny merged 1 commit intoaws:mainfrom
unoptimised:patch-1

Conversation

@unoptimised
Copy link
Copy Markdown
Contributor

Description of changes:

When parts.uri.query() returns Some("") from an API Gateway v2 event with an empty rawQueryString. app_url.set_query(Some("")) appends a bare ? to the forwarded URL.

This change filters out empty query strings so that set_query(None) is called instead, which produces a clean URL with no trailing ?. Non-empty query strings are unaffected.

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

@github-actions
Copy link
Copy Markdown

📊 Benchmark Comparison

Benchmark Details
  • Baseline: main branch
  • Comparison: This PR
  • Threshold: 10% regression triggers warning

Copy link
Copy Markdown
Contributor

@bnusunny bnusunny left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the contribution.

@bnusunny bnusunny merged commit 8914843 into aws:main Mar 12, 2026
4 checks passed
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